jquery Paging Control real-page effect (1/5)

Source: Internet
Author: User

Remember the current page when you modify the delete operation;
3: The query after the page can remember the current query conditions

3.2 implementation
Html


Copy code code as follows:
<!--containers for storing data-->
<div class= "Tabledata" >
</div>
<!--paging control display-->
<div class= "Pagebar" ></div>

Jquery
For our control to be free to use, we will write it as a plug-in form, first of all, we have a framework, we named the plug-in SimplePage
Copy code code as follows:
(function ($) {
$.fn.simplepage=function (o) {
var options={
Configuration parameters
};
Return//sth
}
}) (jquery)

What are the default parameters?
Because of the need to send the current page, the number of each page display, so need to currentpage,pagesize two basic parameters;
Because you need to query the table content, you need a form to place the query criteria;
Because you need to modify the deletion and remember the current page, you need a flag to indicate what type of action is currently in progress;
To make our program more flexible, plus the container to be loaded after getting the data, there is the pager that the paging control loads,
Specifically as follows
Copy code code as follows:
var options={
Pager: '. Pager ',//container for table controls
Container: '. Tabledata ',//container for placing tabular data
Form: ' #form ',//forms for placing query criteria
Pageform: ' #pageform ',//placing the hidden div
URL: ',//send the requested address
Currentpage:1,
Pagesize:2
type:null,//Optional: Action,
Pageshow:7
}

For ease of maintenance, we declare a separate object to get the data, bind the event, and we'll name the function $.page
Copy code code as follows:
$.page = {
//
Setpage:function (o) {
},
Get current Page
Getcurrentpage:function (o) {
},
Get the number of display per page
Getpagesize:function (o) {
},
Generate the JSON data needed to send
Gendata:function (o) {
},
Send data
Loaddata:function (o) {
}
}

home 1 2 3 4 5 last

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.