目前我在 jqgrid 中面临一个问题。使用 ajax 调用加载网格后,我将数据类型更改为本地网格完成。在那之后我试图过滤但我得到零记录。任何帮助表示赞赏。
以下是我的代码: -
$("#orderformtable").jqGrid(
{
url : "getOrderFormProductList.htm?VENDORID=" + VENDORID
+ "&LOCATIONID=" + LOCATIONID,
mtype : 'GET',
datatype : "json",
colNames : [ 'Product', 'Pipeline Qty.', 'A', 'B', 'C',
'D', 'Order Qty.' ],
colModel : [ {
name : 'PRODUCT_NAME',
index : 'PRODUCT_NAME',
width : 80,
editable : false,
hidden : false,
editrules : {
required : true
},
editoptions : {
disabled : true,
size : "40",
maxlength : "70"
}
}, {
name : 'PIPELINE_QTY',
index : 'PIPELINE_QTY',
width : 20,
editable : false,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
}, {
name : 'MAX_QTY',
index : 'MAX_QTY',
width : 15,
editable : true,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
}, {
name : 'INSTOCK_QTY',
index : 'INSTOCK_QTY',
width : 20,
editable : false,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
}, {
name : 'VENDOR_PIPELINE',
index : 'VENDOR_PIPELINE',
width : 20,
editable : false,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
}, {
name : 'REQUIRED_QTY',
index : 'REQUIRED_QTY',
width : 20,
editable : false,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
}, {
name : 'REORDER_QTY',
index : 'REORDER_QTY',
width : 20,
editable : true,
search : false,
editoptions : {
size : "7",
maxlength : "6"
},
editrules : {
required : true
},
align : 'center'
} ],
loadonce : true,
localReader : {
repeatitems : true
},
hidegrid : false,
postData : {},
rowNum : 200,
rowList : [ 200, 220, 230 ],
height : 500,
autowidth : true,
rownumbers : true,
pager : '#orderformpagination',
sortname : 'PRODUCT_NAME',
viewrecords : true,
gridview : true,
sortorder : "asc",
caption : "",
emptyrecords : "Empty records",
loadonce : false,
gridComplete : function() {
$("#orderformtable").setGridParam( {
datatype : 'local',
ignoreCase : true
});
},
loadComplete : function() {
var rowid = jQuery("#orderformtable").jqGrid(
'getDataIDs');
for ( var i = 0; i < rowid.length; i++) {
$('#orderformtable').jqGrid('editRow', rowid[i]);
}
}
});
下面是我的 jsonarray 重排表单控制器:-
{
"total": 1,
"rows": [
{
"cell": [
"Ball Pen",
4,
100,
10,
0,
90
],
"id": "1220"
},
{
"cell": [
"BATTERY DURACELL 9V PER PC",
1,
50,
10,
0,
40
],
"id": "1101"
},
{
"cell": [
"Brown Tape 2 inch per pc",
0,
30,
10,
0,
20
],
"id": "1108"
},
{
"cell": [
"CELLO TAPE 1 INCH- PER PC",
0,
80,
10,
0,
70
],
"id": "1115"
},
{
"cell": [
"CUTTER PAPER MEDIUM",
0,
25,
10,
0,
15
],
"id": "1122"
},
{
"cell": [
"Scissor big (per pc)",
0,
0,
0,
0,
0
],
"id": "1199"
}
],
"records": 6,
"page": 1
}