【发布时间】:2012-01-04 06:01:52
【问题描述】:
我正在使用 jqgrid 4.0。网格在页面加载时使用 'local' 数据类型 loadonce:'true' 加载,我不想使用分页。由于要加载的数据很大,因此加载需要大量时间。我该怎么做
仅先加载带有标题的网格,将加载文本显示为“正在加载....”,然后加载数据?现在,网格和数据一起加载,页面在完成之前不会出现。
在网格中加载数据更快?
下面是我的代码 sn-p 其中“数据”是 json 编码的数组形成的服务器端。
<script type="text/javascript">
jQuery("#list9").jqGrid({
data: data,
datatype: "local",
colNames:[...],
colModel:[...],
sortname: 'fld_name',
rowNum: '-1',
loadonce:true,
mtype: "GET",
gridview: true,
viewrecords: true,
sortorder: "asc",
pager: '#pager9',
rownumbers: true,
multiselect: false,
width: '100%',
pgbuttons:false,
pgtext:'',
loadtext: 'loading....',
ignoreCase: true
});
jQuery("#list9").jqGrid('filterToolbar', {stringResult: true,searchOnEnter : false});
$('.ui-widget-header').css("background", "#7B9FBC");
$('.ui-jqgrid-sortable').css("text-align", "left");
</script>
【问题讨论】:
标签: jqgrid