页面展示效果。

页面代码:

  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. gitlab安装

    [root@localhost ~]# wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rp ...

  2. .net学习笔记---Asp.net的生命周期之二页生命周期

    用户请求 从 用户角度来说,我不管你后台经历了什么,我只想要我请求的页面.请求到服务器端,服务器必须得有所表示的是吧,即使不想搭理人家也得让IIS给人家说声:找不到服务器.请求来到服务器端,肯定要让服 ...

  3. JAVA基础学习之throws和throw的区别、Java中的四种权限、多线程的使用等(2)

    1.throws和throw的区别 throws使用在函数外,是编译时的异常,throw使用在函数内,是运行时的异常 使用方法 public int method(int[] arr) throws ...

  4. Azure Blob Storage从入门到精通

    今天推荐的是一个系列文章,让读者阅读完成后可以对Azure Blob Storage的开发有一个全面的了解,可谓是从入门到精通. Azure在最初的版本里面就提供了非结构化数据的存储服务,也即Blob ...

  5. c++find函数用法

    头文件 #include <algorithm> 函数实现 template<class InputIterator, class T> InputIterator find ...

  6. 2016"百度之星" - 初赛(Astar Round2A)

    题目链接: http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=701 1001 : 矩阵快速幂 #include <iostre ...

  7. 利用SQL语句查询数据库中所有表

    Oracle: SELECT * FROM ALL_TABLES;系统里有权限的表 SELECT * FROM DBA_TABLES; 系统表 SELECT * FROM USER_TABLES; 当 ...

  8. 一张广告图片引起的思维DFS

    1.概述 今天老同事发了一张图片, 结果后面有几个家伙回了“中毒了...”“这是挖墙脚的节奏么”(对了,这个老同事也离职了). 本来也想说上几句的,发现激情难在. 不过,最近了解到DIP.DM.ML. ...

  9. UVa1401 Remember the Word(DP+Trie树)

    题目给定一个字符串集合有几种方式拼成一个字符串. dp[i]表示stri...strlen-1的方案数 dp[len]=1 dp[i]=∑dp[j](stri...strj-1∈SET) 用集合的字符 ...

  10. POJ1155 TELE(树形DP)

    题目是说给一棵树,叶子结点有负权,边有正权,问最多能选多少个叶子结点,使从叶子到根的权值和小于等于0. 考虑数据规模表示出状态:dp[u][k]表示在u结点为根的子树中选择k个叶子结点的最小权值 最后 ...