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) {
}
}