官网:http://pagination.js.org/
get 方法请求数据
$('#pagination-container').pagination({
dataSource: '/fund/getProductList', //请求的url
locator: 'recordList', //返回值data的位置
totalNumberLocator: function (res) { //返回值总数量的位置
return Math.floor(res.totalCount);
},
numPerPage: 5,
pageRange: 1,
className: '',
prevText: '< 上一页',
nextText: '下一页 >',
showGoInput: false,
showGoButton: false,
callback: function (data, pagination) { //回掉函数
$('#data-container').html(template(data));
}
});
post 方法请求数据
$('#pagination-container').pagination({
dataSource: '/fund/getMyProduct',
ajax:{
type:'post',
url:'/fund/getMyProduct',
data:{customerCode:(AES.aesEncrypt(customerCode, AES.aesKey, AES.iv))}
},
locator: 'recordList', //data的位置
totalNumberLocator: function (res) { //总数量的位置
return Math.floor(res.totalCount);
},
numPerPage: 5,
pageRange: 1,
className: '',
prevText: '< 上一页',
nextText: '下一页 >',
showGoInput: false,
showGoButton: false,
callback: function (data, pagination) {
$('#data-container').html(template(data));
}
});
网友评论