很急,大神帮我看一下啊!!
html
<%--分页--%>
<div id="Pagination" class="pagination" style="margin:0px 0px 10px 12px;">
</div>
js
$('#Pagination').pagination(data.total, {
items_per_page: 100, //每页显示多少条记录
//当前显示第几页数据
num_display_entries: 8, //分页显示的条目数
isShow: true,
next_text: '下一页',
prev_text: '上一页',
num_edge_entries: 2, //连接分页主体,显示的条目数
callback: function(new_page_index) {
$.ajax({
type: "POST",
url: "${ctxPath}/proDataDisplay/selectProTestDatas",
data: {
productId: selectpzproductId,
paramName: selectpzparamName,
unit: selectpzunit,
confCol: thispzText,
pageSize: 100,
currentPage: new_page_index + 1 //new_page_index为0需要加1
},
async: false,
success: function(data) {
console.log(data);
$('.tbodyshow').html(''); //清除之前加载的表格数据
for(var i = 0; i < data.dataList.length; i++) {
$('.tbodyshow').append('<tr id="aa' + i + '">');
$('#aa' + i).append(
'<td>' + data.dataList[i]["id"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["param_name"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["unit"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["state"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["channel_num"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["result"] + '</td>'
);
$('#aa' + i).append(
'<td>' + data.dataList[i]["unique_num"] + '</td>'
);
delete data.dataList[i]["id"];
delete data.dataList[i]["param_name"];
delete data.dataList[i]["unit"];
delete data.dataList[i]["state"];
delete data.dataList[i]["channel_num"];
delete data.dataList[i]["result"];
delete data.dataList[i]["unique_num"];
for(var key in data.dataList[i]) {
if(key == 'creat_time') {
$('#aa' + i).append(
'<td>' +
format(data.dataList[i][key]) + '</td>'
);
} else {
$('#aa' + i).append(
'<td>' + data.dataList[i][key] + '</td>'
);
}
}
}
}
})