基于jQuery、Bootstrap2、3进行开发,支持页面跳转、异步页面、异步数据等多模式的独立分页插件
jQuery插件支持Bootstrap2、3的UI环境带有页面跳转、异步页面(服务端返回页面内容模式)、异步数据(服务端返回JSON数据)三种分页模式,可对业务场景进行灵活处理快速使用皮肤浏览器支持IE8+,chrome,firefox插件使用入门、API文档、使用实例
资源导入 在网页上引用css样式、js脚本等文件
1 2 3 4 5 6 7 | <!-- 插件使用的样式表文件,分bootstrap2和bootstrap3两个环境使用,根据使用环境引用 --><!-- bootstrap2环境使用 --><link rel="stylesheet" href="b.page.css" type="text/css"><!-- bootstrap3环境使用 --><link rel="stylesheet" href="b.page.bootstrap3.css" type="text/css"> <!-- 插件核心脚本 --><script type="text/javascript" src="b.page.js" >< /script> |
HTML代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | <!-- 页面跳转模式为例 --><!-- 前提条件为服务端已将分页数据设置到request中 --><!-- 设置表格,内容区域中使用服务端的el表达式循环生成表格内容 --><table class="bTable table table-striped table-bordered table-hover table-condensed"> <thead> <tr> <th class="selectColumn" >选择</th> <th>登录名</th> <th>姓名</th> <th>性别</th> <th>出生年月</th> <th>电话</th> <th>电子邮箱</th> <th>状态</th> <th>更新时间</th> </tr> </thead> <tbody> <c:if test="${userList.list != null}"> <c:forEach var="d" items="${userList.list}"> <tr class="<c:if test="${d.status == 0}">error</c:if>" id="${d.id}"> <td class="selectColumn"><input type="radio" name="userSelect" value="${d.id}" /></td> <td>${d.login_name}</td> <td>${d.name}</td> <td>${d.sexName}</td> <td><fmt:formatDate pattern="yyyy-MM-dd" value="${d.birthday}" type="date" /></td> <td>${d.phone1}</td> <td>${d.email}</td> <td>${d.statusName}</td> <td><fmt:formatDate pattern="yyyy-MM-dd" value="${d.update_time}" type="date" /></td> </tr> </c:forEach> </c:if> </tbody></table><!-- 必须设置以下分页信息设置,否则插件将无法读取分页数据--><!-- 隐藏内容设置后,在插件初始化时进行读取--><c:if test="${userList != null}"><input type="hidden" id="pageNumber" value="${userList.pageNumber}"><input type="hidden" id="pageSize" value="${userList.pageSize}"><input type="hidden" id="totalPage" value="${userList.totalPage}"><input type="hidden" id="totalRow" value="${userList.totalRow}"></c:if> |
Javascript初始化插件代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | //初始化插件$('#page1').bPage({ //分页目标链接 url : $webroot + 'demo/manage/page', //读取页面设置的分页参数 totalPage : $('#totalPage').val(), totalRow : $('#totalRow').val(), pageSize : $('#pageSize').val(), pageNumber : $('#pageNumber').val(), //自定义传递到服务端的参数 params : function(){ return { userName : 'zhangsan', age : 42 }; }}); |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com