Use experience based on TWBSPAGINATION.JS pagination plugin (sharing)

The project is previously used in the project, which is a plug-in that is simply called Pagenation.js, but when this is integrated, the project team uses this plugin with this plugin, combined with the online example ponders a. In fact, the approximate process is the same, mainly to share some of the experience in this page plug-in:
[1, the page plug-in is introduced into HTML):


Sub-plug-in JS

Written Pieces of Paging CSS [If not, you can use the paging CSS of Bootstrap with Bootstrap.

Using jQuery can introduce jQuery.js


 "/>  <script type="text/javascript" src="  2, when the paging plug-in is used: <link rel="stylesheet" href=" <link rel="stylesheet" href="  
can be defined A special page conversion method, introduced:

ManagementPage: Function (PageSize) {var obj = $ (‘# managepagination’). Twbspagination ({ Totalpages: PageSize, // Total Page StartPage: 1, // Start page VisiblePages: Pagesize> 5? 5: pagesize, // The number of pages, exceeding 5 pages display 5 pages, the total number of pages in INI is not exceededTIATESTARTPAGECLICK: TRUE, HIDEONLYONEPAGE: TRUE, // Only one page does not show P page ONPAGECLICK: FUNCTION (Event, page) {// Click on page event, callback function, can only use AJAX asynchronous loading, temporarily no discovery to operate directly at the front end Data method. $ (this) .addclass (“Active”). Siblings (). RemoveClass (“Active”); var start = (page – 1) * 5 + 1; var end = page * 5 + 1; var param = {‘ Start ‘: start,’ end ‘: End}; ds.managesystem (manageSystemurl, param); // Asynchronous load method, mainly need to bring the start page and the end page back to the background}}); (); // Load paging style},
    3, Note:
The pager is noted when used, if there is other asynchronous load data, After running the page for the first time, the paging style on the page is the first data, and if the asynchronous load is re-entered on the page, and you want the paging to continue in new data, then you need to reference The following code:
// Time-set space paging data (partialpagination ‘). Empty (); $ (‘ #) (); $ (‘# managepagination ‘) .Removedata (“Twbs-PAGINATION”); $ (‘ # managepagination ‘). unbind (‘ page ‘);
This code is placed in placePay attention, you need to put the data that is asynchronously loaded before the data is asynchronously loaded, and the paging plug-in is cleared, and the paging data loaded again is the new data content.

4, the panelock plug-in can be all satisfied with the above code.

The above-based TWBSPAGINATION.JS pagination plug-in is the full content of Xiaobian sharing to everyone, I hope I can give you a reference, I hope everyone will support Tumi. cloud.
© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment