在ext.widow中第二次单击后按钮单击事件未触发

时间:2014-10-03 09:37:23

标签: javascript jquery extjs

你好,我在新闻中担任新人。我想问这个.. 我在ext js中有一个窗口,那里有一个按钮,名为" btnSearchArea"。我必须在单击按钮之前发送参数,以根据参数在树视图中再次显示窗口。

但问题是。 " btnSearchArea"只能一次点击,当我在第一个窗口更改参数并再次单击按钮时。这个按钮没有触发。

这是我的代码 用HTML格式

 <div id="sa-employeedetail-form" class="x-hide-display">
    <table class="sa-form sa-form-field" style="margin: 10px">
        <tr>
            <td>Job Title :
            </td>

            <td>
                @Html.DropDownList("JobTitleID")
            </td>
        </tr>
        <tr>
            <td>Brand :
            </td>

            <td>
                @Html.DropDownList("BrandID")
            </td>
        </tr>
    </table>
    <hr />
    <table class="sa-form sa-form-field" style="margin: 10px">
        <tr>
            <td>Search : </td>
            <td>@Html.DropDownList("ddlSearchArea", items)
            </td>
            <td>
                <input type="text" id="txtSearchAreaP" /></td>
        </tr>
        <tr>
            <td>Area :
            </td>
            <td>
                @Html.TextBox("AreaID", "", new { @class = "sa-required" })
                <button id="btnSearchArea" class="btn-lookup">...</button>
                <br />
                <label id="AreaName"></label>

            </td>
        </tr>
    </table>
</div>

和js

$("#btnSearchArea").click(function () {
    rows = $(this).closest("tr");
    var winArea = Ext.getCmp('winArea');
    if (!winArea) {
        winArea = Ext.create('Ext.window.Window', {
            id: 'winArea',
            title: 'Area List',
            width: 400,
            height: 600,
            modal: true,
            resizable: false,
            autoScroll: true,
            contentEl: 'sa-area-form',
            closeAction: 'close'
        });

        ShowLoading("sa-body", "Please Wait ...");
        $.post(root + "Area/GetAreaByParam", { FieldName: $("#ddlSearchArea").val(), Area: $("#txtSearchAreaP").val() }, function (data) {
            try {
                areaFB = data.Area;
                areaFBVersion = data.Version; 
                rootNodeArea = GenerateAreaObject(areaFB);
                tvHtml = "";
                GenerateAreaFBTreeView(rootNodeArea);
                treeviewAreaFB = "<ul>" + tvHtml + "</ul>";
                //draw tree
                $("#sa-area-form").html(treeviewAreaFB);
                $("#sa-area-form").dynatree({
                    checkbox: false,
                    selectMode: 3,
                    minExpandLevel: 4,
                    onDblClick: function (node, event) {
                        if (node.data.key != "0") {
                            $("#AreaID").val(node.data.key);
                            $("#AreaName").html(node.data.title);
                            $(".areaForm").show();
                            winArea.close();
                        }
                    }
                });
                HideLoading();
                $(".areaForm").show();
                winArea.show();
            } catch (ex) {
                MsgErr(ex);
            }
        })
    } else {
        $(".areaForm").show();
        winArea.show();
    }
});

有什么建议吗?非常感谢:)

0 个答案:

没有答案