Bootstrap分页在项目中的应用
2018-01-23 18:32
176 查看
//scheduleemplShow.jsp
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <% String path = request.getContextPath(); %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <!DOCTYPE html> <html> <head> <jsp:include page="../head.jsp"></jsp:include> <!-- 分页 --> <link rel="stylesheet" href="<%=path%>/static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"> </head> <body class="hold-transition skin-blue sidebar-mini"> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">我的日程</h3> </div> <!-- /.box-header --> <div class="box-body"> <table id="page" class="table table-bordered table-striped" cellpadding="0" cellspacing="0" border="1px"> <!-- 遍历循环传递数据 --> <!-- ============表头============= --> <thead> <tr> <th>日程编号</th> <th>日程内容</th> <th>开始时间</th> <th>结束时间</th> <th>创建时间</th> <th>状态</th> <th>操作</th> </tr> </thead> <tbody> <% int s = 1; %> <c:set var="nowDate" value="<%=System.currentTimeMillis()%>"></c:set> <c:forEach var="scheduleempl" items="${slist}" step="1"> <tr> <td><%=s++%></td> <!-- 给后台获取的数据添加序号 --> <td>${scheduleempl.scheduleContent}</td> <td><fmt:formatDate value="${scheduleempl.scheduleStartTime}" pattern="yyyy年MM月dd日 - HH:mm:ss" /></td> <td><fmt:formatDate value="${scheduleempl.scheduleEndTime}" pattern="yyyy年MM月dd日 - HH:mm:ss" /></td> <td><fmt:formatDate value="${scheduleempl.scheduleCreateTime}" pattern="yyyy年MM月dd日 - HH:mm:ss" /></td> <td><c:choose> <c:when test="${nowDate - scheduleempl.scheduleEndTime.time > 0}"> <font color="#FF0000">已过期</font> </c:when> <c:otherwise> 未完成 </c:otherwise> </c:choose></td> <td><c:choose> <c:when test="${nowDate - scheduleempl.scheduleEndTime.time > 0}"> <a class="btn btn-primary btn-xs" data-toggle="modal" disabled>修改</a> </c:when> <c:otherwise> <a class="btn btn-primary btn-xs" data-toggle="modal" href="editScheduleempl/${scheduleempl.s_id}" class="more" onclick="if(confirm('确定修改?')==false)return false;">修改</a> </c:otherwise> </c:choose> <a class="btn btn-primary btn-xs" data-toggle="modal" href="delScheduleempl/${scheduleempl.s_id}" class="more" onclick="if(confirm('确定删除?')==false)return false;">删除</a></td> </tr> </c:forEach> </tbody> </table> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <!-- /.content --> </div> <div class="control-sidebar-bg"></div> <jsp:include page="../foot.jsp"></jsp:include> <!-- 分页 --> <script src="<%=path%>/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script> <script src="<%=path%>/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script> <script> $(function() { $('#page').DataTable({ "pagingType" : "simple_numbers",//设置分页控件的模式 searching : true,//屏蔽datatales的查询框 aLengthMenu : [ 5, 10, 15 ],//设置一页展示10条记录 "oLanguage" : { //对表格国际化 "sLengthMenu" : "每页显示 _MENU_条", "sZeroRecords" : "没有找到符合条件的数据", //"sProcessing": "<img src=’./loading.gif’ />", "sInfo" : "当前第 _START_ - _END_ 条 共计 _TOTAL_ 条", "sInfoEmpty" : "木有记录", "sInfoFiltered" : "(从 _MAX_ 条记录中过滤)", "sSearch" : "搜索:", "oPaginate" : { "sFirst" : "首页", "sPrevious" : "前一页", "sNext" : "后一页", "sLast" : "尾页" } }, }) }) </script> </body> </html>
相关文章推荐
- [前端插件]Bootstrap Table服务器分页与在线编辑应用总结
- BootStrap table 数据填充与分页应用总结
- 将Bootstrap应用到Aurelia项目中
- [前端插件]Bootstrap Table服务器分页与在线编辑应用总结
- lucene搜索结果分页显示 google、baidu式的分页 我在项目中的应用(二)
- 地图集web项目_技术学习(二)_bootstrap分页的例子
- (转载)Android两种Tab分页的方式:TabActivity和ActivityGroup以及Android项目几种常见的应用架构
- BootStrap中的table实现数据填充与分页应用小结
- bootstrap-fileinput 插件使用总结(最近做项目应用到了这个上传文件的插件,分享下不够完善请指出共同进步)
- html5 bootstrap分页的应用
- sqlserver 存储过程学习笔记(二) 在项目中的应用<多表分页>
- 【SSH项目实战】国税协同平台-27.分页对象应用&抽取pageNavigator
- 【SSH项目实战】国税协同平台-27.分页对象应用&抽取pageNavigator
- 项目经验之:分布式缓存HttpRuntime.cache应用到单点登陆中_优化登陆
- Win8:适用于 Windows 应用商店应用的 JavaScript 项目模板 (Windows)
- 如何优雅的上传iOS项目到应用商店
- Linux下C应用编程学习阶段性小项目 —— 模拟银行ATM(单机版)
- VARCHART XGantt应用实例:用于To-Increase项目管理图形化
- EF/SQL/新闻中分页应用
- 第六周上机项目4-静态成员应用