首页
登录 | 注册

分页插件jquery.simplePagination.js使用笔记

1. test_box.jsp页面:

<script type="text/javascript" src="${ctxJs}/jquery-1.7.2.min.js"></script>

<script src="${ctxJs}/jquery.simplePagination.js"></script>


<input type="hidden" name="pageNo" value="1"/>

<!--结果表格-->
<table class="bad_list" id="loadData"></table>
<!--结果表格end--> 
//分页    
        <div id="paging"></div>
        <div class="pagination-holder" id="pagingD"></div>   


//js请求

function loadInfoList(pageNo) {
var action = "${ctxPath}/test/findlist";
if(pageNo==undefined){
pageNo = $("#paging").pagination('getCurrentPage');
}
$("[name = 'pageNo']").val(pageNo);
var data = $("#formId").serializeArray();
var index =  layer.load(0, {shade: false,offset : ['300px','500px']});
$("#loadData").load(
action,
data,
function(response, status, xhr) {//查询后台
//var vv=response; 

 //请求返回的数据先填充test_data.jsp页面的tbody,然后把test_data.jsp页面(即response)带到当前页面test_box.jsp填充table

if (status == "success") {
layer.close(index)
var totalNum = $("#assessListNum").val();
$("#paging").pagination('drawPage',pageNo);
$("#paging").pagination('updateItems', totalNum);
$("#pagingD").html(
"<p>共<span>" + totalNum + "</span>条记录,每页<span>"
+ $("#numPerPage").val()
+ "</span>条,当前第<em>"
+ $("#assessListCurrentPage").val()
+ "</em>页/共<em>"
+ $("#assessListTotalPage").val()
+ "</em>页</p>")

}
})
}


2. Controller层:

@RequestMapping(value = "/test/findInfo", method = RequestMethod.POST)
public String findccbBadInfo(Model model,HttpServletRequest request, AnalysisReq analysisReq) {
MyDataList listResult = alanalysisService.findInfo(analysisReq);
model.addAttribute("result", listResult);
return "analysis/test_data";
}

3.test_data.jsp:(只有一个tbody)

<tbody>
<tr class="first">
<th>地址</th>
<th>时间</th>
<th>金额</th>
<th>余额</th>
<th>价值</th>
</tr>
<tr>
<td style="text-align: left; padding-left:10px;"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</c:otherwise>
</c:choose>
</tbody>





2020 jeepxie.net webmaster#jeepxie.net
10 q. 0.008 s.
京ICP备10005923号