简体   繁体   English

jqgrid搜索过滤器弹出窗口没有出现

[英]jqgrid search filter popup not appearing

After much frustration I finally got the search icon to appear in the navigator area but now when I click on it the screen turns "modal" but no search dialog appears! 几经无奈之后,我终于使搜索图标出现在导航器区域中,但是现在当我单击它时,屏幕变成“模式”,但没有出现搜索对话框!

Here's the head section of my code: 这是我的代码的开头部分:

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <link href="../Styles/Examiners.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jqgrid/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jqgrid/searchFilter.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jqgrid/ui.multiselect.css" rel="stylesheet" type="text/css" />

    <script src="../Scripts/jqgrid/grid.locale-en.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.jqGrid.src.js" type="text/javascript"></script>

    <script src="../Scripts/jqgrid/grid.addons.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.postext.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.setcolumns.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.contextmenu.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.tablednd.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/ui.multiselect.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.searchFilter.js" type="text/javascript"></script>


</asp:Content>

And here's my grid definition 这是我的网格定义

            $("#examinersGrid").jqGrid({
                url: baseUrl() + selectQuery(),
                mtype: "POST", 
                ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
                serializeGridData: function (postData) {
                    if (postData.searchField === undefined) postData.searchField = null;
                    if (postData.searchString === undefined) postData.searchString = null;
                    if (postData.searchOper === undefined) postData.searchOper = null;
                    //if (postData.filters === undefined) postData.filters = null;
                    return JSON.stringify(postData);
                },
                datatype: 'json',
                colNames: ["Name", "Assignments"],
                colModel: [
                    { name: 'displayName', index: 'displayName', width: 200, },
                    { name: 'assignments', index: 'assignments', width: 120,
                        formatter: 'integer', sorttype: 'int', align: 'right'
                    }
                ],
                jsonReader: {
                    root: "d.rows",
                    page: "d.page",
                    total: "d.total",
                    records: "d.records",
                    id: "examinerID"
                },
                autowidth: true,
                height: "auto",
                rowNum: 10,
                loadonce: false,
                gridview: true,
                pager: "#examinersPager",
                search: {
                    caption: "Search...",
                    Find: "Find",
                    Reset: "Reset",
                    odata: ['equal', 'not equal', 'less', 'less or equal', 'greater', 'greater or equal', 'begins with', 'does not begin with', 'is in', 'is not in', 'ends with', 'does not end with', 'contains', 'does not contain'],
                    groupOps: [{ op: "AND", text: "all" }, { op: "OR", text: "any"}],
                    matchText: " match",
                    rulesText: " rules"
                },
                rowList: [10, 20, 30],
                sortname: "displayName",
                sortorder: "asc",
                viewrecords: true,
                autoencode: true,
            }).navGrid('#examinersPager', { add:false, edit: false, del: false, refresh: false, search: true });

        }); 

Any ideas? 有任何想法吗? I'm tearing my hair out here! 我在这里扯头发!

It's quite simple, really... I'm not sure what triggered it. 这很简单,真的...我不确定是什么触发了它。 The solution was to move my jquery.jqGrid.src.js reference below all the plugin references above it. 解决方案是将我的jquery.jqGrid.src.js参考移到其上方所有插件参考的下方。

Sigh. 叹。 So it's that old javascript gotcha of making sure the script references come in the right order. 因此,这是确保脚本引用顺序正确的老javascript技巧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM