私は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ページに表示されます:
アップデート
私のjqgridは使用していてdatetype : json
、また必要です。私はloadonce : true
すでにこのように試用しています:
- loadonceを変更します:false->すべてのレコードが表示されますが、ツールバーフィルターを使用できません
- loadonceを変更します:true->結果には10レコードしか表示されませんが、ツールバーフィルターは機能します
- loadonce:true、rowNum:50->データは50のみを表示します(次のボタンを無効にします)
- phpmyadminでクエリを確認->すべてのデータが表示できる結果(クエリOK)
- 別のテーブルを使用する(OK 1)->結果はまだ機能しません
- 別のページを使用してjqgridを添付->まだ機能しない
jqgridが10レコードのみを取得するのに、このテーブルには実際には100.000レコードがあるのはなぜですか?そして、なぜこのテーブルだけが機能するのに、別のテーブルが機能するのか。