createDatagrid with pagination

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就能得到了...然后 按照你的分页去做..应该没有问题...

 

 

 

 

转载于:https://www.cnblogs.com/xiaoyee/archive/2012/11/04/2753506.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值