bootstrap table 服务器端分页例子分享
function getTab(){
var url = contextPath+'/fundRetreatVoucher/fundBatchRetreatVoucherQuery.htm'; $('#tab').bootstrapTable({ method: 'get',//这里要设置为get,不知道为什么 设置post获取不了 url: url, cache: false,宋体; font-size:14px; line-height:25.2px">height: 400,宋体; font-size:14px; line-height:25.2px">striped: true,宋体; font-size:14px; line-height:25.2px">pagination: true,宋体; font-size:14px; line-height:25.2px">pageList: [10,20],宋体; font-size:14px; line-height:25.2px">// contentType: "application/x-www-form-urlencoded",宋体; font-size:14px; line-height:25.2px">pageSize:10,宋体; font-size:14px; line-height:25.2px">pageNumber:1,宋体; font-size:14px; line-height:25.2px">search: true,宋体; font-size:14px; line-height:25.2px">sidePagination:'server',//设置为服务器端分页 queryParams: queryParams,//参数 showColumns: true,宋体; font-size:14px; line-height:25.2px">showRefresh: true,宋体; font-size:14px; line-height:25.2px">minimumCountColumns: 2,宋体; font-size:14px; line-height:25.2px">clickToSelect: true,宋体; font-size:14px; line-height:25.2px">smartDisplay:true,宋体; font-size:14px; line-height:25.2px">columns: [ { field: 'interfaceInfoCode',宋体; font-size:14px; line-height:25.2px">title: '资金通道编码',宋体; font-size:14px; line-height:25.2px">align: 'center',宋体; font-size:14px; line-height:25.2px">width: '180',宋体; font-size:14px; line-height:25.2px">valign: 'bottom',宋体; font-size:14px; line-height:25.2px">sortable: true },{ field: 'retreatBatchCode',宋体; font-size:14px; line-height:25.2px">title: '资金退回批次号',宋体; font-size:14px; line-height:25.2px">width: '200',宋体; font-size:14px; line-height:25.2px">valign: 'middle',宋体; font-size:14px; line-height:25.2px">field: 'total',宋体; font-size:14px; line-height:25.2px">title: '总笔数',宋体; font-size:14px; line-height:25.2px">width: '10',宋体; font-size:14px; line-height:25.2px">valign: 'top',宋体; font-size:14px; line-height:25.2px">field: 'totalMoney',宋体; font-size:14px; line-height:25.2px">title: '总金额',宋体; font-size:14px; line-height:25.2px">width: '100',宋体; font-size:14px; line-height:25.2px">clickToSelect: false title: '操作',宋体; font-size:14px; line-height:25.2px">field: 'state',宋体; font-size:14px; line-height:25.2px">}] }); } //设置传入参数 function queryParams(params) { ? return params $(function(){ getTab(); }) 后台: 获取limit offset ,有些网站上 要格式化传入参数 获取pageSize,pageIndex 反正我是没有成功,如果知道 可以分享给我 int currentPage = request.getParameter("offset") == null ? 1 : Integer.parseInt(request.getParameter("offset")); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |