jqgrid搜索条件不显示

jqgrid search condition not showing

我正在尝试弄清楚如何在 jqgrid 4.6 中使用搜索功能,基本上我正在做与此处相同的事情:http://www.codeproject.com/Articles/58357/Using-jqGrid-s-search-toolbar-with-multiple-filter

但是在搜索面板中没有任何条件显示,应该有 'equal' 或 'contain' 我可以 select :

这是我的代码,我错过了什么吗?

 function showGrid() {
    $('#ListMessagesGrid').jqGrid({
        caption: paramFromView.Caption,
        colNames: ['EB_USER_MESSAGE_ID', paramFromView.MESSAGE_INFO_IDENTIFIER, paramFromView.MESSAGE_INFO_TIMESTAMP,
          paramFromView.MESSAGE_PARTY_FROM, paramFromView.MESSAGE_PARTY_TO, paramFromView.MESSAGE_COLLAB_SERVICE,
        paramFromView.MESSAGE_COLLAB_ACTION, paramFromView.MESSAGE_COLLAB_AGREEMENTREF, paramFromView.MESSAGE_COLLAB_CONVERSATION_ID],
        colModel: [
                    { name: 'EB_USER_MESSAGE_ID', index: 'EB_USER_MESSAGE_ID', width: 80, hidden: false, key: true, search: false },
                    { name: 'MESSAGE_INFO_IDENTIFIER', index: 'MESSAGE_INFO_IDENTIFIER', width: 600, searchoptions: { sopt: ['eq', 'cn'] } },
                    { name: 'MESSAGE_INFO_TIMESTAMP', index: 'MESSAGE_INFO_TIMESTAMP', width: 450 },
                    { name: 'MESSAGE_PARTY_FROM', index: 'MESSAGE_PARTY_FROM', width: 200 },
                    { name: 'MESSAGE_PARTY_TO', index: 'MESSAGE_PARTY_TO', width: 200 },
                    { name: 'MESSAGE_COLLAB_SERVICE', index: 'MESSAGE_COLLAB_SERVICE', width: 450 },
                    { name: 'MESSAGE_COLLAB_ACTION', index: 'MESSAGE_COLLAB_ACTION', width: 300 },
                    { name: 'MESSAGE_COLLAB_AGREEMENTREF', index: 'MESSAGE_COLLAB_AGREEMENTREF', width: 350 },
                    { name: 'MESSAGE_COLLAB_CONVERSATION_ID', index: 'MESSAGE_COLLAB_CONVERSATION_ID', width: 650 }
        ],
        hidegrid: false,
        multiselect: true,
        pager: jQuery('#ListMessagesPager'),
        sortname: 'EB_USER_MESSAGE_ID',
        rowNum: paramFromView.PageSize,
        rowList: [10, 20, 50, 100],
        sortorder: "desc",
        width: paramFromView.Width,
        height: paramFromView.Height,
        datatype: 'json',
        caption: paramFromView.Caption,
        viewrecords: true,
        autoencode : true,
        mtype: 'GET',
        jsonReader: {
            root: "rows",
            page: "page",
            total: "total",
            records: "records",
            repeatitems: false,
            userdata: "userdata"
        },
        url: paramFromView.Url
    }).navGrid('#ListMessagesPager', { view: false, del: false, add: false, edit: false },
       { width: 400 }, // default settings for edit
       {}, // default settings for add
       {}, // delete instead that del:false we need this
        {
            closeOnEscape: true, multipleSearch: true,
            closeAfterSearch: true
        }, // search options
       {} /* view parameters*/
     ).navButtonAdd('#ListMessagesPager', {
         caption: paramFromView.DeleteAllCaption, buttonimg: "", onClickButton: function () {
             if (confirm(paramFromView.DeleteAllConfirmationMessage)) {
                 document.location = paramFromView.ClearGridUrl;
             }
             else {
                 $('#ListMessagesGrid').resetSelection();
             }
         }, position: "last"
     });
};

更新

我发现了一些东西:

由于某种原因,aoprs 数组中的所有值都未定义,因此下拉列表未填充,是否有解决此问题的方法?

您确定在出现问题的应用程序中 jquery.jqGrid.min.js 之前包含了 i18n/grid.locale-en.js 吗?这是案例中的典型错误。

我建议您尝试使用更新版本的 jqGrid。我开发例如 free jqGrid. It's the fork of jqGrid based on jqGrid 4.7: the latest version available under MIT and GPLv2 licenses. Free jqGrid are provided also under MIT and GPLv2 licenses. The main file jquery.jqGrid.min.js (or jquery.jqGrid.src.js) already includes English locale i18n/grid.locale-en.js. So one need to include locale file only in case of usage other language. Free jqGrid contains a lot of additional enhancements which I described in wiki and readmes to every version. If you want to use free jqGrid in internet application that I recommend you to use URLs from CDN. See the wiki 篇文章详解。