1. The required js introduced in the front desk can be downloaded from the official website
The code copy is as follows:
function getTab(){
var url = contextPath+'/fundRetreatVoucher/fundBatchRetreatVoucherQuery.htm';
$('#tab').bootstrapTable({
method: 'get', //There is to be set to get here, I don't know why I can't get it when I set the post
url: url,
cache: false,
height: 400,
striped: true,
pagination: true,
pageList: [10,20],
// contentType: "application/x-www-form-urlencoded",
pageSize:10,
pageNumber:1,
search: true,
sidePagination:'server',//Set as server-side pagination
queryParams: queryParams,//parameters
showColumns: true,
showRefresh: true,
minimumCountColumns: 2,
clickToSelect: true,
smartDisplay:true,
columns: [
{
field: 'interfaceInfoCode',
title: 'Fund Channel Code',
align: 'center',
width: '180',
valign: 'bottom',
sortable: true
}, {
field: 'retreatBatchCode',
title: 'Funds return batch number',
align: 'center',
width: '200',
valign: 'middle',
sortable: true
}, {
field: 'total',
title: 'Total number of writing',
align: 'center',
width: '10',
valign: 'top',
sortable: true
}, {
field: 'totalMoney',
title: 'Total Amount',
align: 'center',
width: '100',
valign: 'middle',
clickToSelect: false
}, {
title: 'Operation',
field: 'state',
align: 'center',
width: '200',
valign: 'middle',
}]
});
}
//Set incoming parameters
function queryParams(params) {
return params
}
$(function(){
getTab();
})
2 Backstage
Get limit offset , some websites need to format the incoming parameters to get pageSize, pageIndex Anyway, I have not succeeded, if you know, you can share it with me
The code copy is as follows:
int currentPage = request.getParameter("offset") == null ? 1 : Integer.parseInt(request.getParameter("offset"));
// Number of rows per page
int showCount = request.getParameter("limit") == null ? 10 : Integer.parseInt(request.getParameter("limit"));/
if (currentPage != 0) {// Get the number of pages
currentPage = currentPage / showCount;
}
currentPage += 1;
JSONObject json = new JSONObject();
json.put("rows", bfrv); //The rows and total keys here are fixed
json.put("total", total);
The above is the entire content of this article. I hope you can like it.