2
我有一个jqGrid与json数据类型和loadOnce: true
。我正在使用filterToolBar
搜索。它不会返回所有匹配。该网格包含名为的可搜索列名称并且具有值“Adkins,Joe”和“Adkinson,Jane”。如果我输入搜索字符串“Adk”,唯一返回的匹配是“Adkins,Joe”。FilterToolBar不返回所有匹配
这里是网格的定义:
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" })
}
})
谢谢奥列格! rowNum设置修复了搜索问题。我还会实施您的其他建议。 – MLS
@MLS:不客气! – Oleg