由于我是jqGrid中的新成员,对此问题我非常困惑。 我的数据只显示10行。这是我的剧本;jqGrid只显示10行
jQuery("#list").jqGrid({
url:'dounfinish.php?q=1',
datatype: 'json',
mtype: 'POST',
closeafteredit:true,
colNames:['id','Date', 'Line','Model','Lotno','Qty','PIC'],
colModel :[
{name:'id', index:'id', hidden:true, width:55},
{name:'Date', index:'Date', width:90, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Line', index:'Line', width:80, editable:true, search:true, stype:'text',searchoptions:{sopt:['cn']}},
{name:'Model', index:'Model', width:180, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Lotno', index:'Lotno', width:80, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}},
{name:'Qty', index:'Qty', width:80, editable:true, search:true, stype:'text',searchoptions:{sopt:['cn']}},
{name:'PIC', index:'PIC', width:180, editable:true, search:true, stype:'text',searchoption:{sopt:['cn']}}
],
// pager: jQuery('#pager'),
gridview:true,
pager: '#pager',
width: '100%',
height: '100%',
rowNum:10,
rowList:[10,20,30],
sortname: 'Date',
sortorder: "desc",
viewrecords: true,
loadonce: true,
// imgpath: 'themes/basic/images',
caption: 'DAILY CHECK QTY',
editurl:'process3.php',
prmNames:{oper:'action',editoper:'editbaldefect',id:'def_id'}
});
等的情况:
loadonce: true result View 1 - 10 of 10 --> column filter can work.
loadonce: false result View 1 - 10 of 3500 --> column filter not working.
为什么?
在开发工具显示:
{"page":1,"total":33223,"records":"332222","rows":[]}
,但在PHP的页面出现:
UPDATE
使用datetype : json
也是我的jqGrid需要loadonce : true
。我已经审判像硫S:
- 变化loadonce:假 - >所产生的所有记录显示,但无法使用工具栏过滤器
- 变化loadonce:真 - >结果只显示10条记录,但工具栏过滤器可以工作
- loadonce :true,rowNum:50 - > data only only 50(next button disable)
- 检查查询在phpmyadmin - >结果所有数据都可以显示(查询OK)
- 使用另一个表(OK一) - >结果仍然不起作用
- 使用另一个页面,然后附加jqgr id - >仍然没有工作
为什么jqgrid只能检索10条记录,但是这个表实际上有100.000条记录? 为什么只是这张桌子,而另一张桌子可以工作。
此页面是从其他页面复制的。对于原始页面它可以工作(服务器页面查询使用'SELECT *'),但是对于这个页面不起作用(服务器页面查询使用'SELECT ... JOIN ...')。 – nunu
为什么服务器只响应10行?实际上我的查询获得了100.000多条记录。 – nunu
@nunu:对不起,我已经回答过这个问题。如果你不使用'loadonce:true'(或者如果你使用'loadonce:false')**你的服务器负责数据的分页,排序和过滤**。 jqGrid只是发送参数'page','rows','sidx'等。服务器应该返回**请求的排序和过滤**数据页面。 ''行':'响应的一部分包含数据页面,但是'“页面”',''total“'和”records“'应该正确填写。您在服务器响应中填写明确错误的信息。 – Oleg