我遇到了jqgrid搜索问题。我的代码与添加,编辑,删除除了搜索完美匹配。一旦我加载它,数据显示正常,但如果我点击查找按钮,它永远不会做任何事情。
我一直在寻找它,但我找不到什么错。如果我使用loadonce : true
然后搜索工作,但现在有分页和排序网格的问题。我想让它与分页,排序和搜索完美配合。
这是我的代码。
$("#material_list").jqGrid({
url:"MY URL",
editurl:"MY URL",
mtype:"post",
caption:"LIST",
datatype:"json",
height:"auto",
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: true
},
rowNum:10,
rowList:[5,10,15],
colNames:["PROD_CODE","PROD_NAME","COMP_CODE","UNIT","STANDARD","USEFLAG"],
colModel:[
{name:"PROD_CODE", index:"PROD_CODE", editable:true},
{name:"PROD_NAME", index:"PROD_NAME", editable:true},
{name:"COMP_CODE", index:"COMP_CODE", editable:true},
{name:"UNIT", index:"UNIT", editable:true},
{name:"STANDARD", index:"STANDARD", editable:true},
{name:"USEFLAG", index:"USEFLAG", editable:true}
],
pager:"#pager",
autowidth:true,
viewrecords:true,
//loadonce:true,
});
$("#material_list").jqGrid(
"navGrid",
"#pager",
{search:true, edit:true, add:true, del:true},
{closeAfterEdit:true, reloadAfterSubmit:true},
{closeAfterAdd:true, reloadAfterSubmit:true},
{reloadAfterSubmit:true}
);