JQuery Pagination 分页插件 增加了首页尾页以及跳转功能
JQuery分页插件
挺好用的
但是官方是没有提供首页尾页以及跳转功能
我觉得这个功能可以有,于是就改进了一下
一个js一个css从连接里面下
链接:http://pan.baidu.com/s/1nvaq99R 密码:9nfb
还有记得引入jquery,这个必须有
上效果图:

页面代码
<script type="text/javascript">
//分页查询开始
$(document).ready(function() {
getDataList(0, null);
}); var rows = 10;
var page = 1;
var initFlag = true; function getDataList(currPage, jg) { $.ajax({
url : "page",
type : "post",
dataType : 'json',
data : {rows : rows,page : currPage + 1},
contentType : "application/x-www-form-urlencoded; charset=utf-8",
success : function(response) {
if (response.result) {
if (response.data != null && response.data != ""&& response.total != undefined && response.total > 0) {
if (initFlag) {
$("#Pagination").pagination(
response.total,
{
items_per_page : rows,
num_edge_entries : 1,
num_display_entries : 8,
callback : getDataList//回调函数
});
initFlag = false;
}
$("#listData").html("");
loadDataList(response.data);
} else {
//暂无数据
}
} else {
//暂无数据
}
}
});
} function loadDataList(listdata) {
//表头
var html ="<tr class='t-header'>"+
"<td>头像</td>"+
"<td>姓名</td>"+
"<td>密码</td>"+
"</tr>";
$("#listData").append(html);
for (var i = 0; i < listdata.length; i++) {
var n = listdata[i];
//表格
var html = "<tr>"+
"<td>"+"<img src='getphoto?unid="+n.uuid+"' onerror='this.src=\"resources/img/default.png\"' style='width:48px;height:48px;border-radius:48px;'/>"+"</td>"+
"<td>"+n.username+"</td>"+
"<td>"+n.password+"</td>"+
"</tr>";
$("#listData").append(html);
}
}
//分页查询结束
</script>
<body>
<div class="clearbox">
<div class="x-box">
<h2><a>表格</a></h2>
<table id="listData"></table>
</div>
<div id="Pagination" class="pagination"></div>
</div>
</body>
后台代码
/**
* 分页请求地址
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping("page")
public Map<String, Object> page(HttpServletRequest request,HttpServletResponse response){
int total = userService.getTotal();
int page = Integer.parseInt(request.getParameter("page"));//当前页
int rows = Integer.parseInt(request.getParameter("rows"));//每页条数
List<User> data =userService.getCurrentPage((page-1)*rows, rows);
boolean result = (data == null)?false:true;
Map<String, Object> map = new HashMap<String, Object>();
map.put("data", data);
map.put("total", total);
map.put("result", result);
return map;
}
就先这样,有什么不清楚的可以给我留言。
JQuery Pagination 分页插件 增加了首页尾页以及跳转功能的更多相关文章
- jQuery Pagination分页插件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- jQuery Pagination分页插件--刷新
源码地址:https://github.com/SeaLee02/FunctionModule/blob/master/UploadFiles/WebDemo/FenYE/FenYeDemo.aspx ...
- Jquery Pagination分页插件使用
JqueryPagination是个简单轻量级的分页插件,使用起来很容易,只要初始化一个实例,并设置总数量.翻页回调函数.其它参数就可以实现无刷新分页功能了. 准备工作 下载jquery.min.js ...
- jQuery Pagination分页插件--无刷新
源码:https://github.com/SeaLee02/FunctionModule/blob/master/UploadFiles/WebDemo/FenYE/FenYeAjax.aspx 代 ...
- jQuery Pagination分页插件的使用
一.引用CSS和JS: <link href="/Content/Plugins/jQuery.Pagination_v2.2/pagination.css" rel=&qu ...
- Jquery前端分页插件pagination使用
插件描述:JqueryPagination是一个轻量级的jquery分页插件.只需几个简单的配置就可以生成分页控件.并且支持ajax获取数据,自定义请求参数,提供多种方法,事件和回调函数,功能全面的分 ...
- Slider 滚动条 Pagination分页插件 JS Ajax 数据范围筛选 加载 翻页 笔记
入职以后的第二个任务 根据用户所选的价格范围 筛选数据 修复BUG - 筛选数据后 总数没有更新.列表显示错误.翻页加载错误 用到的一些知识点 jquery插件系列之 - Slider滑块 max ...
- jquery.pagination.js 新增 首页 尾页 功能
jquery.pagination.js 新增 首页 尾页 功能 废话不多说,直接上修改后的代码,修改部分已经用 update 注释包含 17-20行 99-103行 141-145行 /** * T ...
- Jquery前端分页插件pagination同步加载和异步加载
上一篇文章介绍了Jquery前端分页插件pagination的基本使用方法和使用案例,大致原理就是一次性加载所有的数据再分页.https://www.jianshu.com/p/a1b8b1db025 ...
随机推荐
- Android上的SQLLite性能分析
也许有人还不知道,Android 是有一些内建的 类库支持 SQL Lite 数据库的操作.他提供了一个很好的方式在 Android 上组织少量的数据.不管怎样,在使用这些类库的时候有一些陷阱是需要注 ...
- ibatis 分页的简单实现
ibatis 物理分页的简单实现 cheungmine 2013-8-26 使用SSI (Struts2, Spring3, iBATIS2.3)框架开发Web服务的时候有一个需求就是对查询得到的结果 ...
- MySQL错误:Can't connect to MySQL server (10060)
转自:http://database.51cto.com/art/201107/274565.htm 当远程连接MySQL数据库的时候显示Can't connect to MySQL server ( ...
- Java模式(适配器模式)
今天看了下Java中的适配器模式,下面就来小做下总结和谈谈感想,以便日后使用. 首先,先来先讲讲适配器.适配就是由“源”到“目标”的适配,而其中链接两者的关系就是适配器.它负责把“源”过度到“目标”. ...
- PHP __autoload函数(自动载入类文件)的使用方法(转)
详细出处参考:http://www.jb51.net/article/29625.htm 在使用PHP的OO模式开发系统时,通常大家习惯上将每个类的实现都存放在一个单独的文件里,这样会很容易实现对类进 ...
- centos 安装http协议的git server
1.服务器端安装httpd,git,gitweb等 1 #yum install httpd git git-daemon gitweb 2.服务器端初始化仓库 1 2 3 #mkdir -p /d ...
- oc-28-构造函数
Dog.h #import <Foundation/Foundation.h> @interface Dog : NSObject { NSString *_name; int _age; ...
- 在应用程序中实现对NandFlash的操作
以TC58NVG2S3ETA00 为例: 下面是它的一些物理参数: 图一 图二 图三 图四 图五 图6-0 图6-1 说明一下,在图6-1中中间的那个布局表可以看做是实际的NandFlash一页数据的 ...
- 关于删除7z历史解压路径
目前7zip尚无此功能,只能从注册表入手了,7zip历史记录保存在注册表 HKEY_CURRENT_USER\Software\7-Zip\FM 下的CopyHistory和FolderHistory ...
- Python Counter()计数工具
Table of Contents 1. class collections.Counter([iterable-or-mapping]) 1.1. 例子 1.2. 使用实例 2. To Be Con ...