jqGrid-未显示寻呼机.如何启用? [英] jqGrid - Pager not shown. How to enable it?
本文介绍了jqGrid-未显示寻呼机.如何启用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道为什么,但是我使用jqGrid和pager无法正确显示.我可以显示viewrecords
,但不能显示寻呼机.桌子的其余部分都可以.
I dont know why, but im using jqGrid and pager not show properly. I could show the viewrecords
, but pager not. The rest of the table works ok.
有人可以告诉我问题出在哪里吗
Could anybody give me any idea about where is the problem.
我的JQGrid是:
jQuery('#report_table').jqGrid({
scroll: 'true',
url:'getReportTableData.json',
datatype: 'json',
height: 400,
width: 800,
colNames:['Futures','Units'],
colModel:[
{name:'Futures',index:'Futures', width: 150, sortable: false},
{name:'Units',index:'Units', width: 150, sortable: false],
rowNum:100,
loadonce:'false',
shrinkToFit: 'true',
mtype: 'POST',
pager: '#preport_table',
postData: { idReport : '75' },
viewrecords: 'true',
loadComplete : function (data) {
if (data.error == 1){
$('#dialog-modal').dialog({
height: 140, width: 300, modal: true, title: ' Error ',
buttons: { cerrar : function() {
$(this).dialog('close');
}
}
});
$('#dialog-modal').html(msgError(data.msg));
}
},
caption: '',
hidegrid: 'true',
});
并且html代码是
<table id='report_table'></table> <div id='preport_table' ></div>
谢谢.
推荐答案
您的主要问题是scroll: true
选项.在该选项的文档中,您将找到以下内容:
You main problem is the scroll: true
option. In the documentation of the option you will find the following:
启用后,将禁用寻呼机元素,我们可以使用 垂直滚动条以加载数据.
When enabled, the pager elements are disabled and we can use the vertical scrollbar to load data.
此外,您的代码中存在一些语法错误,应予以修复:
Moreover your code has some syntax errors which you should fix:
-
colModel
的第二列不包含'}'(请参阅']'之前的内容. - 布尔值应被编码为
true
和false
,而不是字符串'true'
和'false'
(请参见scroll: 'true'
,loadonce:'false'
,shrinkToFit: 'true'
,viewrecords: 'true'
,hidegrid: 'true'
)
- the second column of the
colModel
contain no '}' (see before ']'). - boolean values should be codded as
true
andfalse
and not as strings'true'
and'false'
(seescroll: 'true'
,loadonce:'false'
,shrinkToFit: 'true'
,viewrecords: 'true'
,hidegrid: 'true'
)
这篇关于jqGrid-未显示寻呼机.如何启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文