1、重载JqGrid数据
$("#list2").jqGrid('setGridParam',{url:url}).trigger("reloadGrid");
2、自定义格式化输出(formatter);参数cellValue:当前单元格的值。rowObject:当前行对象,含整行数据的属性。options:当前单元格的options设置,包括{rowId, colModel,pos,gid}
jQuery("#myId").jqGrid({
url:'xxx.do',
datatype: "json",
colNames:['字段1'],
colModel:[
{name:'字段1',index:'字段1', width:120,formatter: function(cellValue,options,rowObject){alert(index.字段1)
return pdJDDState(row,isShowDJState);
}}
]
});
本文介绍了如何使用JqGrid进行数据重载,并通过自定义formatter实现数据的灵活展示。重点展示了如何设置gridParam、触发reloadGrid方法,以及在formatter中实现复杂的条件判断和函数调用。
4317

被折叠的 条评论
为什么被折叠?



