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());
- }
转载于:https://www.cnblogs.com/telwanggs/p/5455742.html
MyBatis+springMVC+easyUI (dataGirl)实现分页相关推荐
- Mysql分页加pagebean_Spring+MyBatis+SpringMvc+Mysql+Druid+PageHelper分页实现
我是阿福,公众号「阿福聊编程」作者,一个在后端技术路上摸盘滚打的程序员,在进阶的路上,共勉!文章已收录在 JavaSharing 中,包含Java技术文章,面试指南,资源分享. 思路分析 MyBati ...
- Mybatis+springMVC+分页查询+前后端代码
Mybatis+springMVC+分页查询+前后端代码 前言 我们在公司中经常会用到分页查询,最近,我在做一个公司的任务的时候,调用外部系统时需要将结果封装成分页的数据,之前我们都是直接调用我们公司 ...
- Spring+Mybatis+SpringMVC+Maven+MySql(SSM框架)搭建实例
这篇文章我们来实现使用maven构建工具来搭建Spring+Mybatis+SpringMVC+MySql的框架搭建实例.工程下载 使用maven当然得配置有关环境了,不会配置的请看我前几篇文章,都有 ...
- springmvc与mysql实例_Spring+Mybatis+SpringMVC+Maven+MySql搭建实例
摘要:本文主要讲了如何使用Maven来搭建Spring+Mybatis+SpringMVC+MySql的搭建实例,文章写得很详细,有代码有图片,最后也带有运行的效果. 一.准备工作 1. 首先创建一个 ...
- EasyUI的DataGrid 分页栏英文改中文解决方案
EasyUI的DataGrid 分页栏英文改中文解决方案 参考文章: (1)EasyUI的DataGrid 分页栏英文改中文解决方案 (2)https://www.cnblogs.com/tahn30 ...
- 使用Mybatis如何对Mysql进行分页功能?
使用Mybatis如何对Mysql进行分页功能 1.Limit实现分页 接口 //分页List<User> getUserByLimit(HashMap<String, Intege ...
- EasyUI的datagrid分页,动态隐藏或显示列
EasyUI的datagrid分页,动态隐藏或显示列 业务需要,根据不用的查询条件,显示不同的列名 1 $("#chnMode").change(function(){ 2 if( ...
- Mybatis + SpringMVC + Maven实现分页查询
使用Mybatis + Maven + SpringMVC 运行时,突然被需要分页查询的功能给难住了 这里推荐采用的插件是PageHelper这个插件,使用起来十分方便.该插件支持以下数据库: Ora ...
- 【超详细】SSM框架项目实战|Spring+Mybatis+Springmvc框架项目实战整合-【CRM客户管理系统】——课程笔记
相关资料网盘链接: CRM客户管理系统资料 提取码 :0u04 P1--CRM阶段简介: web项目开发:如何分析,设计,编码,测试. 形成编程思想和编程习惯. P2--CRM的技术架构 ...
最新文章
- 基于EasyNVR摄像机网页无插件直播服务二次开发实现H5播放页面的简单集成方案...
- 【numpy】协方差计算
- TPC-W安装与配置(威斯康星大学Java版)
- mysql 语句性能分析_mysql的sql语句的性能诊断分析
- 如何用SAP Cloud for Customer的手机App创建销售订单
- 3、数据库中的字符集和校对集
- Python习题week1
- doc命令操作数据库(下)
- 【渝粤教育】国家开放大学2019年春季 2633轨道交通信号与通信系统 参考试题
- 使用npm和命令行强制删除文件
- 图样图森破:认识WiFi以后
- iphone申请AppleID后无法登陆App Store
- 败走中国,是亚马逊们的宿命
- 基于STM32单片机的智能药盒带语音播报原理图程序
- 【数理知识】Lipschitz 条件 Lipschitz 常数
- 考研最易出现的几种心理状态,让人崩溃!
- linux打开文件乱码
- 包你笑,笑话之三 超强情侣对话
- 用C++完成QRCode(快速响应码)的基本逻辑实现
- 九段刀客:express连接MySQL并实现增、删、改、查
热门文章
- es html标签,ES 6 Number
- (92)如何解决信号高扇出问题,例如复位信号
- (27)FPGA面试题动态时序模拟
- FPGA学无止境(目录篇)
- 12020.硬件电路
- 7002.ubuntu18.04将软件图标固定到工具栏
- python函数体以冒号起始、并且是缩进格式的_函数体以冒号起始,并且是缩进格式的。(3.0分)_学小易找答案...
- 【飞控理论】从零开始学习Kalman Filters之二:最优状态估计、最优估计算法和方程
- ajax html页面传值乱码,jQuery Ajax传值到Servlet出现乱码问题的解决方法
- pixhawk学习笔记---创建新的应用程序