Bootstraptable server-side paging example sharing _ jquery

Source: Internet
Author: User
This article mainly introduces the bootstraptable server-side paging example sharing. For more information, see section 1. you can download the required js introduced at the front end from the official website.

The code is as follows:


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.

The code is as follows:


Int currentPage = request. getParameter ("offset") = null? 1: Integer. parseInt (request. getParameter ("offset "));
// Number of lines 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 );

The above is all the content of this article. I hope my friends will like it.

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.