//<%@?page?language="java"?contentType="text/html;?charset=UTF-8"
????pageEncoding="UTF-8"%>
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib?prefix="c"?uri="http://java.sun.com/jsp/jstl/core"?%>
<%@taglib?prefix="fn"?uri="http://java.sun.com/jsp/jstl/functions"?%>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8">
<title>雇員信息</title>
</head>
<%
//?獲取請求的上下文
String?context?=?request.getContextPath();
%>
<link?href="/css/pagination.css"?rel="stylesheet"?type="text/css"/>
<script?type="text/javascript"?src="/js/jquery-1.11.3.js"></script>
<script?type="text/javascript"?src="/js/jquery.pagination.js"></script>
<script?type="text/javascript">
//?點(diǎn)擊分頁按鈕以后觸發(fā)的動作
function?handlePaginationClick(new_page_index,?pagination_container)?{
????$("#stuForm").attr("action",?"<%=context?%>/JdbcSqlServlet?pageNum="?+?(new_page_index+1));
????$("#stuForm").submit();
????return?false;
}
$(function(){
$("#News-Pagination").pagination(${result.totalRecord},{
????????items_per_page:${result.pageSize},?//?每頁顯示多少條記錄
????????current_page:${result.currentPage}-1,?//?當(dāng)前顯示第幾頁數(shù)據(jù)
????????num_display_entries:8,?//?分頁顯示的條目數(shù)
????????next_text:"下一頁",
????????prev_text:"上一頁",
????????num_edge_entries:2,?//?連接分頁主體,顯示的條目數(shù)
????????callback:handlePaginationClick
});
});
</script>
<body>
<div?style="margin-left:?100px;?margin-top:?100px;">
<div>
<font?color="red">${errorMsg?}</font>
</div>
<div>
<form?action="<%=context?%>/JdbcSqlServlet"???id="stuForm"??method="post">
姓名
<input?type="text"?name="stuName"?id="stu_name"?style="width:120px"?value="${stuName?}">
<input?type="submit"?value="查詢">
</form>
</div>
<br>
學(xué)生信息列表:<br>
<br>
<!--?后臺返回結(jié)果為空?-->
<c:if?test="${fn:length(result.dataList)?eq?0?}">
<span>查詢的結(jié)果不存在</span>
</c:if>
<!--?后臺返回結(jié)果不為空?-->
<c:if?test="${fn:length(result.dataList)?gt?0?}">
<table?border="1px"?cellspacing="0px"
style="border-collapse:?collapse">
<thead>
<tr?height="30">
<th?width="100">雇員工號</th>
<th?width="100">雇員姓名</th>
<th?width="100">雇員工作</th>
<th?width="100">雇傭日期</th>
<th?width="100">雇員薪水</th>
<th?width="100">雇員獎金</th>
<th?width="100">領(lǐng)導(dǎo)編號</th>
<th?width="100">部門編號</th>
<th?width="100">領(lǐng)導(dǎo)名稱</th>
</tr>
</thead>
<c:forEach?items="${result.dataList?}"?var="emp">
<tr>
<td><c:out?value="${emp.empno?}"></c:out></td>
<td><c:out?value="${emp.ename?}"></c:out></td>
<td><c:out?value="${emp.job?}"></c:out></td>
<td><c:out?value="${emp.hiredate?}"></c:out></td>
<td><c:out?value="${emp.sal?}"></c:out></td>
<td><c:out?value="${emp.comm?}"></c:out></td>
<td><c:out?value="${emp.leano?}"></c:out></td>
<td><c:out?value="${emp.deptno?}"></c:out></td>
<td><c:out?value="${emp.leaname?}"></c:out></td>
</tr>
</c:forEach>
</table>
<br>?
<div?id="News-Pagination"></div>
</c:if>
</div>
</body>
</html>今天學(xué)習(xí)了老師講的jquery插件實(shí)現(xiàn)分頁,但是插件內(nèi)容不顯示。
添加回答
舉報
0/150
提交
取消