我有一个加载一次 jqgrid,它使用自定义格式化程序来显示 bool 值的复选框,这些复选框仅在单击保存按钮时才会保留。但是,无论何时单击排序,都不会保留所有复选框的选中状态。
jQuery("#list2").jqGrid({
url:myurl,
datatype: "json",
loadonce: true,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'isChecked',index:'isChecked', width:90, formatter:chkFmatter},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"JSON Example"
});
jQuery("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
function chkFmatter(cellvalue, options, rowObject) {
// do something here to format column
return new_format_value
}
无论如何,我可以保留在排序、分页等时单击了哪些复选框?