关于datagird 分页的说明
2017-06-15 18:01
148 查看
datagird 分页
首先 dategird分页需要将pagination为true属性
这个框架在加载数据的时候除了你传的业务上的参数以外他会自动传
private int page; // 当前第几页
private int rows; // 每页要显示的记录数
这两个值
然后你就可以根据这个来写分页的sql
然后传回前台的时候 肯定是想将一个list对象显示在表格里面 但是如果分页的话需要组装一下返回页面的对象
这个 total是总的数量
比如你要前台一页显示10条数据 list是根据分页查出的十条数据 而total是查出的总的数量
经过封装返回前台以后就能分页了ps:获取前台分页对象的js
datagird的一些详细属性以及方法 连接http://www.cnblogs.com/prefect/p/5664513.html
首先 dategird分页需要将pagination为true属性
这个框架在加载数据的时候除了你传的业务上的参数以外他会自动传
private int page; // 当前第几页
private int rows; // 每页要显示的记录数
这两个值
然后你就可以根据这个来写分页的sql
然后传回前台的时候 肯定是想将一个list对象显示在表格里面 但是如果分页的话需要组装一下返回页面的对象
public class PageVo<T> implements Serializable{ private static final long serialVersionUID = 5722825796603434484L; private int total; private List<T> rows; public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public List<T> getRows() { return rows; } public void setRows(List<T> rows) { this.rows = rows; } }
这个 total是总的数量
比如你要前台一页显示10条数据 list是根据分页查出的十条数据 而total是查出的总的数量
经过封装返回前台以后就能分页了ps:获取前台分页对象的js
//获取当前的分页对象 var p = $('#dg').datagrid('getPager'); $(p).pagination({ pageSize: 10,//每页显示的记录条数,默认为10 pageList: [10,20,30],//可以设置每页记录条数的列表 beforePageText: '第',//页数文本框前显示的汉字 afterPageText: '页 共 {pages} 页', displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录', /* onBeforeRefresh:function(){ $(this).pagination('loading'); alert('before refresh'); $(this).pagination('loaded'); } */ });
datagird的一些详细属性以及方法 连接http://www.cnblogs.com/prefect/p/5664513.html
相关文章推荐
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于datagird 分页的说明
- 关于SqlDataReader不支持分页的问题
- 关于2.6 的 platform_data,以spi驱动说明之
- django form关于clean及cleaned_data的说明 以及4种初始化
- 关于datagirdview
- 关于dropdowndatawindow的几个说明
- 关于SqlDataReader的几点说明
- 关于2.6 的 platform_data,以spi驱动说明之
- 关于全局量的.data存放地址的说明
- 关于data2ext/data2sd的一些原理说明
- 关于OpenCV中IplImage的char类型的ImageData需要进行强制类型转换为uchar的说明
- DataGirdView存储过程分页 For Winfrom