huzai 2013-10-21
<div id="myBox"> <table id="myTable"></table> </div>
①如果jqGrid的colModel没有改变,仅仅是请求参数有变,重新加载数据
$grid = $('#myTable'); $grid.jqGrid({}); $grid.clearGridData() .jqGrid('setCaption', myNewCaption) .setGridParam({url:myNewUrl,postData: $.toJSON(params)}) .trigger("reloadGrid");
②如果jqGrid的colModel也变了,暴力一点吧
$grid = $("<table id='myTable'></table>"); $('#myBox').empty().html($grid); $grid.jqGrid({});