It was found that the data was loaded two times after the Data-options was written directly on the table, and then placed in $ ();
Additionally, the default paging Pageszie is set.
1 $ (function () {2 //Add tip to the stars when you're done loading3$("#dg"). DataGrid ({4Rownumbers:true,5Url:'datagrid_data1.aspx',6Method'Get',7Fittrue,8Striped:true,9Pagination:true, Ten onloadsuccess:function (data) { One Addtipforstar (); A } - }); - the varp = $ ('#dg'). DataGrid ('Getpager'); - $ (P). Pagination ({ -PageSize: the,//number of records displayed per page, default is ten -PageList: [ the, -, $],//you can set a list of the number of record bars per page +Beforepagetext:'Section',//Chinese characters displayed in front of page text box -Afterpagetext:'page Total {pages} page', +Displaymsg:'The current display {from}-{to} records a total of {all} records' A }); at});
See the first load of default pagesize or 10 via Firefox. Change it to this.
1 $ (function () {2 //Add tip to the stars when you're done loading3$("#dg"). DataGrid ({4Rownumbers:true,5Url:'datagrid_data1.aspx',6Method'Get',7Fittrue,8Striped:true,9Pagination:true, TenPageSize: the,//number of records displayed per page, default is ten OnePageList: [ the, -, $],//you can set a list of the number of record bars per page A onloadsuccess:function (data) { - Addtipforstar (); - } the }); - - varp = $ ('#dg'). DataGrid ('Getpager'); - $ (P). Pagination ({ +Beforepagetext:'Section',//Chinese characters displayed in front of page text box -Afterpagetext:'page Total {pages} page', +Displaymsg:'The current display {from}-{to} records a total of {all} records' A }); at});
Data binding is also written in the data-options of th.
Problems with the DataGrid default paging in Easyui