页面展示效果。

页面代码:

  1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  2. <%@include file="/common/common.jsp" %>
  3. <html>
  4. <head>
  5. <title></title>
  6. </head>
  7. <body>
  8. <h2>样片库管理</h2>
  9. <div style="padding:8px;height:auto">
  10. 参数项名称: <input class="easyui-validatebox" type="text" name="name" data-options="required:true">
  11. 创建时间: <input class="easyui-datebox" name="createTime" style="width:80px">
  12. <a href="#" class="easyui-linkbutton" iconCls="icon-search">查找</a>
  13. <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</a>
  14. </div>
  15. <table id="tt" class="easyui-datagrid" style="width:910px;height:350px"
  16. title="参数项列表" iconCls="icon-save"
  17. rownumbers="false" pagination="true">
  18. </table>
  19. <script type="text/javascript">
  20. $('#tt').datagrid({
  21. title: "参数项列表",
  22. url: '/getAllParam',
  23. pageSize:5,
  24. columns: [
  25. [
  26. {field: 'paramId', title: '参数ID', width: 180, align: "center"},
  27. {field: 'paramName', title: '参数名称', width: 180, align: "center"},
  28. {field: 'paramLabel', title: '标签', width: 180, align: 'center'},
  29. {field: 'createTime', title: '创建时间', width: 180, align: "center"}
  30. ]
  31. ], toolbar: [
  32. {
  33. text: '添加',
  34. iconCls: 'icon-add',
  35. handler: function () {
  36. openDialog("add_dialog", "add");
  37. }
  38. },
  39. '-',
  40. {
  41. text: '修改',
  42. iconCls: 'icon-edit',
  43. handler: function () {
  44. openDialog("add_dialog", "edit");
  45. }
  46. },
  47. '-',
  48. {
  49. text: '删除',
  50. iconCls: 'icon-remove',
  51. handler: function () {
  52. delAppInfo();
  53. }
  54. }
  55. ]
  56. });
  57. //设置分页控件
  58. var p = $('#tt').datagrid('getPager');
  59. p.pagination({
  60. pageSize: 5,//每页显示的记录条数,默认为10
  61. pageList: [5, 10, 15],//可以设置每页记录条数的列表
  62. beforePageText: '第',//页数文本框前显示的汉字
  63. afterPageText: '页    共 {pages} 页',
  64. displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
  65. });
  66. </script>
  67. </body>
  68. </html>

mapper.xml

  1. <!-- 分页查询-->
  2. <select id="selectAllPage" resultMap="BaseResultMap" parameterType="java.util.Map" >
  3. select
  4. <include refid="Base_Column_List"/>
  5. from param_item
  6. <include refid="Example_Where_Clause"/>
  7. limit #{pageIndex},#{pageSize}
  8. </select>

controller方法

    1. @RequestMapping(value = "getAllParam")
    2. public void getAllParam(HttpServletRequest request, HttpServletResponse response,
    3. @RequestParam(required = false, defaultValue = "1") Integer page, //第几页
    4. @RequestParam(required = false, defaultValue = "10") Integer rows, //页数大小
    5. @RequestParam(required = false, defaultValue = "") String paramName,
    6. @RequestParam(required = false, defaultValue = "") String createTime
    7. ) throws IOException {
    8. JSONObject params = new JSONObject();
    9. params.put("pageSize", rows);
    10. params.put("pageIndex", (page-1)*rows);
    11. if (StringUtil.notEmpty(paramName)) {
    12. params.put("paramName", paramName);
    13. }
    14. if (StringUtil.notEmpty(createTime)) {
    15. }
    16. List list = paramItemService.getAllItemPage(params);
    17. JSONObject result = new JSONObject();
    18. result.put("rows", list);
    19. result.put("total", 11);
    20. ResponseUtil.sendJsonNoCache(response, result.toJSONString());
    21. }

MyBatis+springMVC+easyUI (dataGirl)实现分页的更多相关文章

  1. SSM后台管理系统(Spring SpringMVC Mybatis Mysql EasyUI)

    非常简单的一个后台管理系统,功能不多,框架也不复杂, 源码下载(附数据库)-ssm后台管理系统框架(Spring mvc + mybatis + mysql + easyui ) 实例图片

  2. Spring+Mybatis+SpringMVC后台与前台分页展示实例(附工程)(转)

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文实现了一个后台由Spring+Mybatis+SpringMVC组成,分页采用Pag ...

  3. Spring+Mybatis+SpringMVC后台与前台分页展示实例(附工程)

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文实现了一个后台由Spring+Mybatis+SpringMVC组成,分页采用Pag ...

  4. Spring+Mybatis+SpringMVC后台与前台分页展示实例

    摘要:本文实现了一个后台由spring+Mybatis+SpringMVC组成,分页采用PageHelper,前台展示使用bootstrap-paginator来显示效果的分页实例.整个项目由mave ...

  5. 【原】EasyUI ComboGrid 集成分页、按键示例

    需求: 1.下拉框下拉时出现表格: 2.表格带分页功能: 3.可以使用向上键.向下键在表格中移动选择行数据: 4.可以使用回车键在表格中选中行数据: 5.在下拉框的文本框中输入内容,能查询表格: 6. ...

  6. maven SpringMVC easyUI项目创建

    在Eclipse中使用Maven创建SpringMVC项目,项目所需软件及工具可以在官网下载.Maven.Nexus及Eclipse集成Maven等到此配置完毕. 1.Maven创建Web项目. 打开 ...

  7. EasyUI的datagrid分页

    EasyUI的datagrid分页 前台代码: <script type="text/javascript"> $(function () { //查询 search( ...

  8. Spring+Mybatis+SpringMVC+Maven+MySql搭建实例

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲了如何使用Maven来搭建Spring+Mybatis+SpringMVC+M ...

  9. easy-ui treegrid 实现分页 并且添加自定义checkbox

    首先第一点easy-ui  treegrid 对分页没有好的实现, 因为在分页的过程中是按照 根节点来分页的  后台只能先按照 根节点做分页查询  再将子节点关联进去, 这样才能将treegrid 按 ...

随机推荐

  1. ios xcode Could not load the "MyImage.png" image referenced from a nib in the bundle with identifier "com.mytest.MyProject"

    出现找不到xib指定的图片,需要指定图片的完整路径,不能只是图片名 详见:http://vocaro.com/trevor/blog/2012/10/21/xcode-groups-vs-folder ...

  2. July 11th, Week 29th Monday, 2016

    I want to win a trophy, it's the most important. 我希望获得冠军奖杯,这是最重要的事情. Win a trophy, stand on the very ...

  3. makefile_1(初识make)

    Makefile有三个非常有用的变量.分别是$@,$^,$<代表的意义分别是: $@--目标文件,$^--所有的依赖文件,$<--第一个依赖文件. LIBS = -lmCFLAGS = - ...

  4. RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found

    RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found 在多台Linux服务器SSH相互访问无需密码, 其中进入一台Linus中,对其 ...

  5. 【转】解决编译Apache出现的问题:configure: error: APR not found . Please read the documentation

    这里写的很清楚了,已验证可用 http://blog.csdn.net/linghao00/article/details/7926458

  6. C# 常用正则表达式

    // 匹配移动手机号 @"^1(3[4-9]|5[012789]|8[78])\d{8}$"; // 匹配电信手机号   @"^18[09]\d{8}$";   ...

  7. 在IIS上创建FTP服务

    1 在IIS上创建 ftp站点, 然后设定端口号. 2 设定权限: 追加Everyone,IIS_IUSRS,并设定可读可写. 3 设定FTP授权规则:

  8. BZOJ 1010: [HNOI2008]玩具装箱toy 斜率优化DP

    1010: [HNOI2008]玩具装箱toy Description P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京.他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再 ...

  9. ANT下载和配置

    1) 在环境变量中设置ANT_HOME,值为你的安装目录ANT安装目录 2) 在环境变量中设置JAVA_HOME,值为你的jdk安装目录 3) 把ANT_HOME/bin,JAVA_HOME/bin ...

  10. [转]notepad++各种插件

    http://www.crifan.com/files/doc/docbook/rec_soft_npp/release/htmls/npp_common_plugins.html