加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bootstrap table 服务器端分页例子分享

发布时间:2020-12-17 20:59:54 所属栏目:安全 来源:网络整理
导读:function getTab(){ var url = contextPath+'/fundRetreatVoucher/fundBatchRetreatVoucherQuery.htm'; $('#tab').bootstrapTable({ method: 'get',//这里要设置为get,不知道为什么 设置post获取不了 url: url, cache: false,宋体; font-size:14px; line-he
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"));
? // 每页行数

? int showCount = request.getParameter("limit") == null ? 10 : Integer.parseInt(request.getParameter("limit"));/

? if (currentPage != 0) {// 获取页数
?? currentPage = currentPage / showCount;
? }
? currentPage += 1;
? JSONObject json = new JSONObject();
? json.put("rows",bfrv); //这里的 rows 和total 的key 是固定的?
? json.put("total",total);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读