我正在嘗試爲jqGrid實現ToolBar Search/Filtering。當我在任何一個過濾器中輸入一些文本並點擊輸入時,什麼都不會發生 - 不知道我在這裏做了什麼錯誤。任何幫助表示讚賞:jqGrid filterToolbar無法正常工作 - ASP.NET
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" });