我正在尝试为 jqGrid 实现工具栏搜索/过滤。当我在任何过滤器中输入一些文本并按 Enter 时,什么也没有发生 - 不确定我在这里做错了什么。任何帮助表示赞赏:
jQuery("#list").jqGrid({
datatype: 'json',
url: 'GetIncidents.ashx?view=MyIncidents',
height: "100%",
scrollOffset: 0,
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "ID",
userdata: "userdata",
subgrid: {
root: "rows",
repeatitems: true,
cell: "cell"
}
},
colNames: ['ID', 'Title', 'Assigned To', 'Status', 'Priority', 'Classification', 'Affected User', 'Support Group', 'Last Modified'],
colModel: [
{ name: 'ID', index: 'ID', width: 40, sorttype: 'int', firstsortorder: 'desc' },
{ name: 'Title', index: 'Title', width: 180 },
{ name: 'AssignedUser', index: 'AssignedUser', width: 100, align: 'center' },
{ name: 'Status', index: 'Status', width: 50, align: 'center' },
{ name: 'Priority', index: 'Priority', width: 50, align: 'center' },
{ name: 'Classification', index: 'Classification', width: 150, align: 'center' },
{ name: 'AffectedUser', index: 'AffectedUser', width: 100, align: 'center' },
{ name: 'TierQueue', index: 'TierQueue', width: 100, align: 'center' },
{ name: 'LastModified', index: 'LastModified', width: 120, align: 'center', formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s0', newformat: 'm/d/Y h:i A'}}],
pager: '#pager',
rowNum: 15,
width: 980,
sortname: 'ID',
sortorder: 'desc',
viewrecords: true,
autowidth: true,
gridview: true,
ignoreCase: true,
caption: 'All Open Incidents Assigned To Me',
onSelectRow: function (id) { window.location = 'ViewIncident.aspx?id=' + id; }
});
jQuery("#list").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" });