eayui datagrid 分页 排序 详解
2014-11-29 14:20
295 查看
最近因为经常使用easyui 在做表格时难免后出现排序 及分页的问题,但是 在官网中没有 相关的介绍及例子,所以经过多方面的查找后,终于完成了分页 和排序的功能
首先 页面datagrid 要排序的必要的条件是 2个 sortable:true,remoteSort: false,见标红处
然后就是 easyui每次访问后台数据时都会默认传送两个参数 rows,page
rows ---每页显示多少条数据 ,page--- 第几页
这样大家就知道怎么处理了吧,为了方便大家我封装了一个dll 大家在页面引用下就可以用了
使用用方式 Common_CFJ.Common_CFJ.datagridData(data);
文件下载 http://files.cnblogs.com/DDSkay/Common_CFJ.zip
首先 页面datagrid 要排序的必要的条件是 2个 sortable:true,remoteSort: false,见标红处
function JTContent(titile) { $("#Info").datagrid({ title: titile + "--二级公司", loadMsg: "正在加载数据,请等待!", singleSelect: true, rownumbers: true, remoteSort: false, //必要条件1 autoRowHeight: false, pagination: true, queryParams: { "name": "Tload" }, striped: true, align: 'center', url: "CouInfo.aspx", columns: [[ { field: 'T_COMDESC', title: '单位名称'<spanstyle="color:#ff0000sortable: true, align: 'center' }, { field: '电厂地址', title: '地理位置', align: 'center', sortable: true }, { field: '所属省份', title: '所属省份', align: 'center', sortable: true }, { field: '火电装机容量', title: '火电装机容量(兆瓦)', align: 'center',sortable:true }, { field: '脱硫装置类型装机容量', title: '脱硫装机容量(兆瓦)', align: 'center',sortable: true }, { title: '脱硝装机容量(兆瓦)', field: '脱硝装置类型装机容量', align: 'center', sortable: true }, { title: '火电厂个数', field: '电厂个数', align: 'center', sortable: true }, { title: '火电机组数量(台)', field: '火电机组数量', align: 'center', sortable: true }, { title: '脱硫机组数量(台)', field: '脱硫装置类型机组', align: 'center', sortable: true }, { title: '脱硝机组数量(台)', field: '脱硝装置类型机组', align: 'center', sortable: true }, { title: '脱硫装置套数(套)', field: '脱硫装置套数', align: 'center', sortable: true }, { title: '脱硝装置套数(套)', field: '脱硝装置类型机组', align: 'center', sortable: true }, { title: '二级单位接入情况', field: '二级单位接入情况', align: 'center', sortable: true } ]] }, 'json'); }
然后就是 easyui每次访问后台数据时都会默认传送两个参数 rows,page
rows ---每页显示多少条数据 ,page--- 第几页
这样大家就知道怎么处理了吧,为了方便大家我封装了一个dll 大家在页面引用下就可以用了
使用用方式 Common_CFJ.Common_CFJ.datagridData(data);
文件下载 http://files.cnblogs.com/DDSkay/Common_CFJ.zip
相关文章推荐
- eayui datagrid 分页 排序 详解
- 让Asp.NET的DataGrid可排序、可选择、可分页
- 让Asp.NET的DataGrid可排序、可选择、可分页
- DATAGRID分页,排序,有▲和▼标示的排序(亲身体验)
- DataGrid同时具有分页和排序功能及注意点
- 创建可分页、可排序的 DataGrid
- Datagrid分页、排序、删除代码
- DataGrid常用三种方法:分页,排序,后绑定
- 让Asp.NET的DataGrid可排序、可选择、可分页
- DATAGRID的应用(双向排序,包括checkbox控件,分页,修改,保存,取消)
- 让Asp.NET的DataGrid可排序、可选择、可分页
- Asp.NET的DataGrid排序,选择和分页
- [原创]DATAGRID的应用(双向排序,包括checkbox控件,分页,修改,保存,取消)
- 让Asp.NET的DataGrid可排序、可选择、可分页
- 创建可分页、可排序的 DataGrid
- 让Asp.NET的DataGrid可排序、可选择、可分页
- 让Asp.NET的DataGrid可排序、可选择、可分页
- 创建可分页、可排序的 DataGrid
- 让Asp.NET的DataGrid可排序、可选择、可分页
- 让Asp.NET的DataGrid可排序、可选择、可分页