easyui datagrid上传服务器参数page改名
2016-02-25 16:13
417 查看
//页面$('#table').datagrid({method : 'GET',url : 'http:www.baidu.com',pagination : true,pageSize : 10,pageNumber : 0,pageList : [ 10, 20, 30, 40, 50 ],beforePageText : '第',afterPageText : '页 共 {pages} 页',displayMsg : '当前显示 {from} - {to} 条记录 共 {total} 条记录',fit : true,onBeforeLoad:function(param){ delete param.page;//这里删除默认page属性},columns:[[ { field:'aa0', title:'字段1', width:'5%', align:'center' },{ field:'aa1', title:'字段2', width:'5%', hidden:true, align:'center' },{ field:'aa2', title:'字段3', width:'5%', align:'center' }, ... ]]});点击查询按钮function searchClick(){ var opt = $("#alarmTable").datagrid("options"); $("#alarmTable").datagrid('load', { 'params1':$('#params1').val(), 'params2':$('#params2').val(), 'pageNumber':opt.pageNumber//这里可以自定义参数名,和服务器一致即可 } );}//服务器端@RequestMapping("getTableList")public @ResponseBody Map<String, Object> getTableList(String pageNumber,String rows,String params1,String params2){ if(StringUtils.isBlank(pageNumber)){ pageNumber = "1";//这里为防止页面第一次初始化时的pageNuber为undefined情况 } //去处理完后得到total和rows结果 map.put("total", total);//total键 存放总记录数,必须的 map.put("rows", rows);//rows键 存放每页记录 list return map;}
相关文章推荐
- hdu 4027 Can you answer these queries?
- iOS initWithFrame:frame] 与 [UIButton buttonWithType] 对比
- CodeForces 626 A. Robot Sequence(水~)
- Android uiautomator环境搭建
- angular 服务(factory service constant value provider)学习笔记
- Divide and Conquer
- 1101 Quick Sort
- UIImageView用法
- 浅谈 easyui tabs 的href和content属性
- java request获取各种数据
- incredibuild 命令行 error D8037
- 用数据库连接池解决org.hibernate.exception.JDBCConnectionException:could not execute query
- Ultra-QuickSort(树状数组求逆序对数)
- IOS之UITabBarController
- 基于pt-query-digest的慢查询日志持续追踪 推荐
- 从源代码安装Guidance
- ./configure: error: the GeoIP module requires the GeoIP library.
- 《iOS Human Interface Guidelines》——The Status Bar
- UIResponder
- Formal System-相继式演算(Sequenz)