我有一个 jQgrid,它最初通过来自后端(java struts)的 ajax 调用加载数据。同样,这是一次加载,一旦加载,jqGrid 应该对本地可用的数据进行操作。最初,datatype:json 和一旦加载完成,设置 datatype:local。
现在有没有办法在免费的 jqgrid 中使用 filterToolbar 作为本地数据类型,并提供以下选项;
- 在工具栏中启用自动完成
- excel 喜欢过滤选项
Jqgrid 选项:
jQuery("#listTable").jqGrid({
url:'/WebTest/MainAction.do',
datatype: "json",
colNames: ['Label','Value'],
colModel: [
{name:'label',index:'label',width: 40,search:true, stype:'text',sorttype:'int'},
{name:'value',index:'value',width: 56,search:true, stype:'text',sorttype:'text'}
],
autowidth: true,
autoResizing: { compact: true, widthOfVisiblePartOfSortIcon: 13 },
rowNum: 10,
rowList: [5, 10, 20, "10000:All"],
viewrecords: true,
pager: true,
toppager: true,
rownumbers: true,
sortname: "label",
sortorder: "desc",
caption: "Test 235",
height: "200",
search: true,
loadonce: true,
loadComplete: function (data) {
},
gridComplete: function(){
jQuery("#listTable").jqGrid('setGridParam', { datatype: 'local' });
}
}) .jqGrid("navGrid", { view: true, cloneToTop: true})
.jqGrid("filterToolbar")
.jqGrid("gridResize");