저는 json 데이터 유형이 loadOnce: true
인 jqGrid을 가지고 있습니다. 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
@ ML : 환영합니다! – Oleg