MyBatis+springMVC+easyUI (dataGirl)实现分页

页面展示效果。
页面代码:
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@include file="/common/common.jsp" %>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <h2>样片库管理</h2>
- <div style="padding:8px;height:auto">
- 参数项名称: <input class="easyui-validatebox" type="text" name="name" data-options="required:true">
- 创建时间: <input class="easyui-datebox" name="createTime" style="width:80px">
- <a href="#" class="easyui-linkbutton" iconCls="icon-search">查找</a>
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</a>
- </div>
- <table id="tt" class="easyui-datagrid" style="width:910px;height:350px"
- title="参数项列表" iconCls="icon-save"
- rownumbers="false" pagination="true">
- </table>
- <script type="text/javascript">
- $('#tt').datagrid({
- title: "参数项列表",
- url: '/getAllParam',
- pageSize:5,
- columns: [
- [
- {field: 'paramId', title: '参数ID', width: 180, align: "center"},
- {field: 'paramName', title: '参数名称', width: 180, align: "center"},
- {field: 'paramLabel', title: '标签', width: 180, align: 'center'},
- {field: 'createTime', title: '创建时间', width: 180, align: "center"}
- ]
- ], toolbar: [
- {
- text: '添加',
- iconCls: 'icon-add',
- handler: function () {
- openDialog("add_dialog", "add");
- }
- },
- '-',
- {
- text: '修改',
- iconCls: 'icon-edit',
- handler: function () {
- openDialog("add_dialog", "edit");
- }
- },
- '-',
- {
- text: '删除',
- iconCls: 'icon-remove',
- handler: function () {
- delAppInfo();
- }
- }
- ]
- });
- //设置分页控件
- var p = $('#tt').datagrid('getPager');
- p.pagination({
- pageSize: 5,//每页显示的记录条数,默认为10
- pageList: [5, 10, 15],//可以设置每页记录条数的列表
- beforePageText: '第',//页数文本框前显示的汉字
- afterPageText: '页 共 {pages} 页',
- displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录'
- });
- </script>
- </body>
- </html>
mapper.xml
- <!-- 分页查询-->
- <select id="selectAllPage" resultMap="BaseResultMap" parameterType="java.util.Map" >
- select
- <include refid="Base_Column_List"/>
- from param_item
- <include refid="Example_Where_Clause"/>
- limit #{pageIndex},#{pageSize}
- </select>
controller方法
- @RequestMapping(value = "getAllParam")
- public void getAllParam(HttpServletRequest request, HttpServletResponse response,
- @RequestParam(required = false, defaultValue = "1") Integer page, //第几页
- @RequestParam(required = false, defaultValue = "10") Integer rows, //页数大小
- @RequestParam(required = false, defaultValue = "") String paramName,
- @RequestParam(required = false, defaultValue = "") String createTime
- ) throws IOException {
- JSONObject params = new JSONObject();
- params.put("pageSize", rows);
- params.put("pageIndex", (page-1)*rows);
- if (StringUtil.notEmpty(paramName)) {
- params.put("paramName", paramName);
- }
- if (StringUtil.notEmpty(createTime)) {
- }
- List list = paramItemService.getAllItemPage(params);
- JSONObject result = new JSONObject();
- result.put("rows", list);
- result.put("total", 11);
- ResponseUtil.sendJsonNoCache(response, result.toJSONString());
- }
MyBatis+springMVC+easyUI (dataGirl)实现分页的更多相关文章
- SSM后台管理系统(Spring SpringMVC Mybatis Mysql EasyUI)
非常简单的一个后台管理系统,功能不多,框架也不复杂, 源码下载(附数据库)-ssm后台管理系统框架(Spring mvc + mybatis + mysql + easyui ) 实例图片
- Spring+Mybatis+SpringMVC后台与前台分页展示实例(附工程)(转)
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文实现了一个后台由Spring+Mybatis+SpringMVC组成,分页采用Pag ...
- Spring+Mybatis+SpringMVC后台与前台分页展示实例(附工程)
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文实现了一个后台由Spring+Mybatis+SpringMVC组成,分页采用Pag ...
- Spring+Mybatis+SpringMVC后台与前台分页展示实例
摘要:本文实现了一个后台由spring+Mybatis+SpringMVC组成,分页采用PageHelper,前台展示使用bootstrap-paginator来显示效果的分页实例.整个项目由mave ...
- 【原】EasyUI ComboGrid 集成分页、按键示例
需求: 1.下拉框下拉时出现表格: 2.表格带分页功能: 3.可以使用向上键.向下键在表格中移动选择行数据: 4.可以使用回车键在表格中选中行数据: 5.在下拉框的文本框中输入内容,能查询表格: 6. ...
- maven SpringMVC easyUI项目创建
在Eclipse中使用Maven创建SpringMVC项目,项目所需软件及工具可以在官网下载.Maven.Nexus及Eclipse集成Maven等到此配置完毕. 1.Maven创建Web项目. 打开 ...
- EasyUI的datagrid分页
EasyUI的datagrid分页 前台代码: <script type="text/javascript"> $(function () { //查询 search( ...
- Spring+Mybatis+SpringMVC+Maven+MySql搭建实例
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲了如何使用Maven来搭建Spring+Mybatis+SpringMVC+M ...
- easy-ui treegrid 实现分页 并且添加自定义checkbox
首先第一点easy-ui treegrid 对分页没有好的实现, 因为在分页的过程中是按照 根节点来分页的 后台只能先按照 根节点做分页查询 再将子节点关联进去, 这样才能将treegrid 按 ...
随机推荐
- gitlab安装
[root@localhost ~]# wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rp ...
- .net学习笔记---Asp.net的生命周期之二页生命周期
用户请求 从 用户角度来说,我不管你后台经历了什么,我只想要我请求的页面.请求到服务器端,服务器必须得有所表示的是吧,即使不想搭理人家也得让IIS给人家说声:找不到服务器.请求来到服务器端,肯定要让服 ...
- JAVA基础学习之throws和throw的区别、Java中的四种权限、多线程的使用等(2)
1.throws和throw的区别 throws使用在函数外,是编译时的异常,throw使用在函数内,是运行时的异常 使用方法 public int method(int[] arr) throws ...
- Azure Blob Storage从入门到精通
今天推荐的是一个系列文章,让读者阅读完成后可以对Azure Blob Storage的开发有一个全面的了解,可谓是从入门到精通. Azure在最初的版本里面就提供了非结构化数据的存储服务,也即Blob ...
- c++find函数用法
头文件 #include <algorithm> 函数实现 template<class InputIterator, class T> InputIterator find ...
- 2016"百度之星" - 初赛(Astar Round2A)
题目链接: http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=701 1001 : 矩阵快速幂 #include <iostre ...
- 利用SQL语句查询数据库中所有表
Oracle: SELECT * FROM ALL_TABLES;系统里有权限的表 SELECT * FROM DBA_TABLES; 系统表 SELECT * FROM USER_TABLES; 当 ...
- 一张广告图片引起的思维DFS
1.概述 今天老同事发了一张图片, 结果后面有几个家伙回了“中毒了...”“这是挖墙脚的节奏么”(对了,这个老同事也离职了). 本来也想说上几句的,发现激情难在. 不过,最近了解到DIP.DM.ML. ...
- UVa1401 Remember the Word(DP+Trie树)
题目给定一个字符串集合有几种方式拼成一个字符串. dp[i]表示stri...strlen-1的方案数 dp[len]=1 dp[i]=∑dp[j](stri...strj-1∈SET) 用集合的字符 ...
- POJ1155 TELE(树形DP)
题目是说给一棵树,叶子结点有负权,边有正权,问最多能选多少个叶子结点,使从叶子到根的权值和小于等于0. 考虑数据规模表示出状态:dp[u][k]表示在u结点为根的子树中选择k个叶子结点的最小权值 最后 ...