欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

bootstrap table 服務器端分頁例子分享

 更新時間:2015年02月10日 09:43:45   投稿:hebedich  
這篇文章主要介紹了bootstrap table 服務器端分頁例子分享,需要的朋友可以參考下

1,前臺引入所需的js 可以從官網上下載

復制代碼 代碼如下:

function getTab(){
var url = contextPath+'/fundRetreatVoucher/fundBatchRetreatVoucherQuery.htm';
$('#tab').bootstrapTable({
method: 'get', //這里要設置為get,不知道為什么 設置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',//設置為服務器端分頁
queryParams: queryParams,//參數(shù)
showColumns: true,
showRefresh: true,
minimumCountColumns: 2,
clickToSelect: true,
smartDisplay:true,
columns: [
{
field: 'interfaceInfoCode',
title: '資金通道編碼',
align: 'center',
width: '180',
valign: 'bottom',
sortable: true
}, {
field: 'retreatBatchCode',
title: '資金退回批次號',
align: 'center',
width: '200',
valign: 'middle',
sortable: true
}, {
field: 'total',
title: '總筆數(shù)',
align: 'center',
width: '10',
valign: 'top',
sortable: true
}, {
field: 'totalMoney',
title: '總金額',
align: 'center',
width: '100',
valign: 'middle',
clickToSelect: false
}, {
title: '操作',
field: 'state',
align: 'center',
width: '200',
valign: 'middle',
}]
});
}
//設置傳入參數(shù)
function queryParams(params) {
  return params
}
$(function(){
getTab();
})

2 后臺

獲取limit offset ,有些網站上 要格式化傳入參數(shù) 獲取pageSize,pageIndex 反正我是沒有成功,如果知道 可以分享給我

復制代碼 代碼如下:

int currentPage = request.getParameter("offset") == null ? 1 : Integer.parseInt(request.getParameter("offset"));
  // 每頁行數(shù)
  int showCount = request.getParameter("limit") == null ? 10 : Integer.parseInt(request.getParameter("limit"));/
  if (currentPage != 0) {// 獲取頁數(shù)
   currentPage = currentPage / showCount;
  }
  currentPage += 1;
  JSONObject json = new JSONObject();
  json.put("rows", bfrv); //這里的 rows 和total 的key 是固定的
  json.put("total", total);

以上所述就是本文的全部內容了,希望小伙伴們能夠喜歡。

相關文章

最新評論