我有一个带有 json 数据类型的jqGridloadOnce: true
和. 我正在使用filterToolBar
搜索。它不会返回所有匹配项。该网格包含一个名为Name的可搜索列,并具有值“Adkins, Joe”和“Adkinson, Jane”。如果我输入搜索字符串“Adk”,则返回的唯一匹配项是“Adkins, Joe”。
这是网格定义:
function loadmyGrid(dataUrl, selectUrl) {
$("#myGrid").jqGrid({
url: dataUrl + "?r=" + rand(),
datatype: "json",
mtype: 'GET',
rowNum: -1,
loadonce: true,
ignoreCase: true,
scroll: true,
scrollOffset: 0,
gridview: true,
colNames: ["Employee ID", "Name", "User Name", ""],
colModel: [
{ name: "EmployeeID", width: "125", align: "center", sortable: false, resizable: false, title: false, search: false },
{ name: "Name", width: "150", align: "center", sortable: false, resizable: false, title: false },
{ name: "UserName", width: "125", align: "center", sortable: false, resizable: false, title: false, search: false },
{ name: "UserKey", key: true, width: "135", align: "center", sortable: false, resizable: false, title: false, formatter: selectButtonFormatter, search: false},
],
emptyrecords: "Nothing to display",
beforeSelectRow: function () { return false; },
gridComplete: function () {
$("#myGrid").setGridHeight("100%");
$("#myGrid").filterToolbar({searchOnEnter: false, defaultSearch: "cn" })
}
})