0

我在过滤本地数据时遇到问题。如果我删除 loadonce 参数并从服务器获取结果一切正常。当我想过滤本地数据时出现问题。这是我的网格实现:

orderPosGrid.jqGrid({
        colNames: ['', '', '', '', '', '', '', 'ID', 'Nazwa/Rodzaj', 'Ilość', 'Jedn.', 'Przyczyna zwrotu', 'Napis', '', ''],
        colModel: [
            {name: 'myac', index:'myac', width:0, hidden:true},
            {name: 'commited', index: 'commited', width: 0, editable: false, hidden: true},
            {name: 'hasIlosc', index: 'hasIlosc', width: 0, editable: false, hidden: true},
            {name: 'hasOpis', index: 'hasOpis', width: 0, editable: false, hidden: true},
            {name: 'opisCount', index: 'opisCount', width: 0, editable: false, hidden: true},
            {name: 'id', index: 'id', width: 0, sorttype: 'int', editable: false, hidden: true},
            {name: 'qType', index: 'qType', width: 0, sorttype: 'int', editable: false, hidden: true},
            {name: 'id_prod', index: 'id', width: 30, sorttype: 'int', editable: false},
            {name: 'nazwa', index: 'name', width: 250, editable: false},
            {name: 'ilosc', index: 'quantity', width: 35, align: 'right', sortable: false, search:false, edittype:'text', editable: true, editrules:{custom:true, custom_func:iloscValidate, minValue:1}}, 
            {name: 'jedn', index: 'jedn', width: 35, sortable: false, search:false, align: 'right', editable: false},
            {name: 'opisZwrot', index: 'opisZwrot', width: 170, sortable: false, editable: true, search:false, edittype:'select', formatter: 'select', editoptions:{value:'{{ przyczZwrot }}'}},
            {name: 'opis', index: 'description', width: 170, sortable: false, search:false, editable: true},
           {name: 'group', index: 'group', editable: false, hidden: true},
           {name: 'info', index: 'info', sortable: false, search:false, width: 22}
        ],
        status: 0,
        url: '/ProdList/'+type_id+'/'+order_id+'/',
        datatype: 'json',
        mtype: 'GET',
        ignoreCase:true,
        height: 'auto',
        rowNum: 10000,
        loadonce:true,
        gridview: true,
        viewrecords: true,
        sortname: '',
        sortorder: '',
        pager: '#ProdList_gridPager',
        caption: 'Lista dostępnych produktów',
        subGrid: false,
        editurl: 'clientArray',
        grouping: true,
        groupingView: {
            groupField: ['group'],
            groupOrder: ['asc'],
            groupColumnShow: [false],
            groupText: ['<b>{0}  [{1}]</b>'],
            groupCollapse: false
        },
...
});

我只需要过滤两个字段:id 和 nazwa,其他字段被禁用。我来自服务器的 json 数据如下所示:

{"total":1, "page":"1", "records":"266", "rows":[{"id": "2473_1", "cell":["","1","0","0","","116","1","2473","Adwokat","3","kg.","","","d - Ciasta kremowo-śmietanowe"]},{"id": "2473_2", "cell":["","1","0","0","","116","1","2473","Adwokat","2","kg.","","","d - Ciasta kremowo-śmietanowe"]},{"id": "2473_3", "cell":["","1","1","1","70","116","1","2473","Adwokat","","kg.","","","d - Ciasta kremowo-śmietanowe"]}]}

我想我使用典型的数据配置,不需要 jsonReader 配置。我错了吗?如果您在我的代码中发现一些错误,请提供帮助。

4

1 回答 1

0

从奥列格检查这个答案。jqGrid客户端搜索

如果您正在搜索某些东西,那么您需要实现它,那么您的实现代码在哪里?检查上面的链接,他在那里保存搜索条件。

于 2012-07-30T12:57:51.140 回答