我想在我的网站来实现jqGrid的。一切正常,当我加载一次,但当我重新运行该功能加载它不更新的数据。我做的是删除了表格,然后在我更新之前再添加它。这在Mozilla工作,但当我在IE中运行它崩溃。这里是我的代码:的jqGrid不更新/轰然
<div id="tabs-3">
<table id="userStatistics" style="width:100%">
</table><div id="pager1"></div>
</div>
这里是添加网格的函数。
function generateSummaryStatistics(app, range) {
/*$("#gbox_userStatistics").remove();
$("#pager1").remove();*/
$("#tabs-3").html('<table id="userStatistics" style="width:100%"></table><div id="pager1"></div>');
$("#userStatistics").jqGrid({
url:"/WebServiceURL/GetLogMetricCountinputReportName="+app+"&startLogDate="+range,
datatype: 'xml',
mtype: 'GET',
colNames:['Date','User','Department','Application','Number Times Run'],
colModel: [{name:'logDate', index:'logDate',xmlmap:'logDate'},
{name:'reportUserName', index:'reportUserName',xmlmap:'reportUserName'},
{name:'departmentNumber', index:'departmentNumber',xmlmap:'departmentNumber'},
{name:'reportName', index:'reportName',xmlmap:'reportName'},
{name:'numOfQueries', index:'numOfQueries',xmlmap:'numOfQueries'}],
xmlReader: {
root:"returnList",
row:"UsageMetricsDTO",
repeatitems:false,
id : "departmentNumber"
},
rowNum:10,
rowList:[10, 20, 30, 40, 50],
shrinkToFit:false,
viewrecords: true,
loadonce: true,
caption: 'Summary Statistics',
pager: $('#pager1'),
autoWidth:true,
multiselect:false,
gridview: true,
emptyrecords: "No records Found"
}).navGrid('#pager1',{edit:false,add:false,del:false});
$('.ui-jqgrid-bdiv').css({height: 'auto', 'max-height': 250});
}
任何想法为什么这会导致IE崩溃。
就像我说的是在Mozilla,但一旦它在IE第二次崩溃运行工作正常。我在firebug中或eclipse控制台中没有看到控制台中的任何错误。
谁能帮助或提出一个更好的方式来做到这一点?
感谢,
克雷格