我正在使用带有loadonce的jqgrid 4.6和按列分组。我还根据给定here的分组文档对来自服务器的数据进行了排序。但是当我尝试使用以下代码重新加载数据时,我无法在网格中看到任何数据
jQuery("#RamTargetTable").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
以下是代码
jQuery("#RamTargetTable").jqGrid({
url: '<%=Url.Content("~/RamTarget/GetTargetData")%>',
width: 1220,
height: 250,
datatype: "json",
colNames: [my column names],
colModel: [my model],
emptyrecords: 'No Turbines found for the selected Plant',
searchoptions: { searchhidden: true },
mtype: 'GET',
loadonce: true,
hidegrid: false,
rowList: [],
pager: '#RamTargetTablePager',
viewrecords: true,
caption: "RAM Targets",
pgbuttons: false,
pginput: false,
pgtext: null,
grouping: true,
groupingView: {
groupField: ['SerialNumber'],
groupColumnShow: [true],
hideFirstGroupCol: [true]
},
editurl: '<%=Url.Content("~/RamTarget/AddEditRamTargets")%>',
checkOnSubmit: false,
reloadAfterSubmit: true
});
$('#RamTargetTable').jqGrid('navGrid', '#RamTargetTablePager', { edit: false, add: false, del: false, search: true});
function SendPlantId() {
var plantId = $("#lstPlant").val() == null ? 0 : $("#lstPlant").val();
$.ajax({
url: '<%=Url.Content("~/RamTarget/FilterGrid")%>',
type: "post",
data: { id: plantId, filter: "Plant" },
success: function(data) {
jQuery("#RamTargetTable").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
}
});
}