Create DataGrid
To load data from remote server, you should set 'url' peoperty, where server will return JSON format data. see datagrid document for more about the data format.
1 <table id="tt" class="easyui-datagrid" style="width:600px;height:250px" 2 url="datagrid2_getdata.php" 3 title="Load Data" iconCls="icon-save" 4 rownumbers="true" pagination="true"> 5 <thead> 6 <tr> 7 <th field="itemid" width="80">Item ID</th> 8 <th field="productid" width="80">Product ID</th> 9 <th field="listprice" width="80" align="right">List Price</th> 10 <th field="unitcost" width="80" align="right">Unit Cost</th> 11 <th field="attr1" width="150">Attribute</th> 12 <th field="status" width="60" align="center">Stauts</th> 13 </tr> 14 </thead> 15 </table>
<table id="tt" class="easyui-datagrid" style="width:600px;height:250px" url="datagrid2_getdata.php" title="Load Data" iconCls="icon-save" rownumbers="true" pagination="true"> <thead> <tr> <th field="itemid" width="80">Item ID</th> <th field="productid" width="80">Product ID</th> <th field="listprice" width="80" align="right">List Price</th> <th field="unitcost" width="80" align="right">Unit Cost</th> <th field="attr1" width="150">Attribute</th> <th field="status" width="60" align="center">Stauts</th> </tr> </thead> </table>
We defines datagrid columns and set 'pagination' property to true, which will generate a pagination bar on datagrid bottom. The pagination will send two parameters to server:
page: The page number, start with 1.
rows: The page rows per page.
所以 , 我们在action里面 加两个 字段
int page; int rows;
页面向action提交的时候 action就能得到了...然后 按照你的分页去做..应该没有问题...