Bootstrap table server-side paging example, bootstraptable

Source: Internet
Author: User

Bootstrap table server-side paging example, bootstraptable

 

 

1. You can download the js required for front-end introduction from the official website.

Function getTab (){
Var url = contextPath + '/fundRetreatVoucher/fundBatchRetreatVoucherQuery.htm ';
$ ('# Tab'). bootstrapTable ({
Method: 'get', // set this parameter to get. I don't know why post cannot be obtained.
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 it to the server page
QueryParams: queryParams, // Parameter
ShowColumns: true,
ShowRefresh: true,
MinimumCountColumns: 2,
ClickToSelect: true,
SmartDisplay: true,
Columns :[

{
Field: 'interfaceinfocode ',
Title: 'funding channel Code ',
Align: 'center ',
Width: '200 ',
Valign: 'bottom ',
Sortable: true
},{
Field: 'retreatbatchcode ',
Title: 'Fund return Batch No ',
Align: 'center ',
Width: '200 ',
Valign: 'middle ',
Sortable: true
},{
Field: 'Total ',
Title: 'total number ',
Align: 'center ',
Width: '10 ',
Valign: 'top ',
Sortable: true
},{
Field: 'totalmoney ',
Title: 'Total ',
Align: 'center ',
Width: '200 ',
Valign: 'middle ',
ClickToSelect: false
},{
Title: 'operation ',
Field: 'state ',
Align: 'center ',
Width: '200 ',
Valign: 'middle ',
}]
});
}

 

// Set input parameters
Function queryParams (params ){
Return params
}

$ (Function (){
GetTab ();
})

 

 

2 Background

Get limit offset. Some websites need to format input parameters to get pageSize. pageIndex is not successful. If you know, share it with me.

 

Int currentPage = request. getParameter ("offset") = null? 1: Integer. parseInt (request. getParameter ("offset"); // The number of rows per page int showCount = request. getParameter ("limit") = null? 10: Integer. parseInt (request. getParameter ("limit");/if (currentPage! = 0) {// get the page number currentPage = currentPage/showCount;} currentPage + = 1; JSONObject json = new JSONObject (); json. put ("rows", bfrv); // The keys of rows and total are fixed json. put ("total", total );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.