【发布时间】:2020-10-06 22:28:24
【问题描述】:
使用 jqGrid js v5.5.0,键入时过滤功能不适用于某些字段。
在“标题”字段中键入会导致该列仅显示与输入内容匹配的值。
在串行过滤器中键入“2”不会显示任何内容。
预期结果是串行列的行为与标题列完全相同并显示部分匹配。
所有数据都预加载到网格中。
这是演示问题的代码和小提琴。
http://jsfiddle.net/rboarman/p7uyq6w2/15/
var mydata = [{
"Id": "5b1600409fc4a04a1001af6c",
"HitNumber": "2169957",
"Title": "Centrifuge",
"ClientIdNumber": "",
"Status": "Requested",
"IsVisible": false,
"Manufacturer": "Corning",
"ModelNumber": "6765/C1501",
"SerialNumber": "",
"BookValue": "0",
"Location": "San Francisco, CA",
"ServiceStatus": "",
"Condition": "",
"Category": "Centrifuge",
"Catalog": "Default",
"Selected": "0",
"AvailForRedeploy": "/Date(1485849600000)/"
},
{
"Id": "5b1600409fc4a04a1001af6b",
"HitNumber": "2169956",
"Title": "Centrifuge",
"ClientIdNumber": "",
"Status": "Requested",
"IsVisible": false,
"Manufacturer": "Corning",
"ModelNumber": "6765/C1501",
"SerialNumber": "",
"BookValue": "0",
"Location": "San Francisco, CA",
"ServiceStatus": "",
"Condition": "",
"Category": "Centrifuge",
"Catalog": "Default",
"Selected": "0",
"AvailForRedeploy": "/Date(1485849600000)/",
},
{
"Id": "5b1600409fc4a04a1001af70",
"HitNumber": "2169961",
"Title": "Pipettes",
"ClientIdNumber": "",
"Status": "Available",
"IsVisible": true,
"Manufacturer": "Sartorius",
"ModelNumber": "Picus / Tacta",
"SerialNumber": "",
"BookValue": "0",
"Location": "San Francisco, CA",
"ServiceStatus": "",
"Condition": "",
"Category": "Pipettes",
"Catalog": "Default",
"Selected": "0",
"AvailForRedeploy": "/Date(1485849600000)/",
}
];
grid = $("#jqgrid").jqGrid({
data: mydata, //insert data from the data object we created above
datatype: 'local',
ajaxGridOptions: {
contentType: 'application/json; charset=utf-8'
},
height: 'auto',
colNames: ['Id', 'Serial', 'Title', 'AvailForRedeploy'],
colModel: [{
name: 'Id',
index: 'Id',
hidden: true,
},
{
name: 'HitNumber',
index: 'Hit #',
sortable: true,
search: true
},
{
name: 'Title',
index: 'Title',
sortable: true,
},
{
name: 'AvailForRedeploy',
index: 'AvailForRedeploy',
formatter: 'date',
formatoptions: {
srcformat: "ISO8601Long",
newformat: "m/d/Y h:i A"
},
sortable: true,
}
],
rowNum: 25,
rowTotal: 2000,
loadonce: true,
rowList: [25, 50, 100],
pager: '#pjqgrid',
sortname: 'id',
toolbarfilter: true,
viewrecords: true,
sortorder: "asc",
caption: "",
multiselect: true,
multiboxonly: true,
autowidth: true,
toolbar: [true, "both"],
});
$("#jqgrid").filterToolbar({
stringResult: true,
searchOnEnter: false
});
【问题讨论】:
标签: jqgrid