An easy-to-use, beautifully styled paging control for the front end, with list-bound events, and delete events that can be easily paginated to solve the problem of too much page data.
Pager (Config,page,fun_load,fun_error, Is_cookie)
Contents
- Pager (Config,page,fun_load,fun_error, Is_cookie)
- Config
- Page
- Fun_load
- Fun_error
- Is_cookie
- HTML code
- List_bind (HTML, JSON)
- Callback ()
- Info_del (items)
- Button_active ()
- Button_default ()
Config
Request parameters
page
Page parameters
Fun_load
Page load Events
Fun_error
Load Error Events
Is_cookie
Whether to save cookies
HTML code
< Head >
<title></title>
& nbsp; link href rel = "stylesheet" type = "Text/css" />
& nbsp; script SRC type Span style= "color:blue;" >= "Text/javascript" ></ script >
& nbsp; script SRC type = "Text/javascript" ></ script >
& nbsp; script SRC type = "Text/javascript" ></ script >
<script src= "download.js" type= "Text/javascript" ></script>
</ Head >
< Body >
< Div class= "PageFooter" >
& nbsp; a href class = "Bt_normal Bt_del"; delete </ a >
<Div class= "Pagediv" ></div>
</ Div >
</ Body >
list_bind (HTML, JSON)
Take action after loading data
Example:
var pager = new Pager ({type: "List",
Apidoc_type: $ ('. Txt_type '). attr (' _id '),
Key:text = = _default? "": Text},
{obj: $ ('. Pagediv '),
URL: '/handler/sys/apidoc.ashx ',
Size:10,
Total:10,
Index:1,
}, function (JSON) {
var html = ';
$.each (json.list, function (I, item) {
HTML + = Set_row (item, i);
});
var list_bind = function (HTML, JSON) {alert ("List Binding")};
});
Display effect:
Encapsulation--Example:
Fun_pager (_url,
{type: "List", Object_type:type, Date:date, Key:key, Task_user: $ ('. Serach_user '). attr (' _id ')},
Set_row, {
Del_param: {url: _url},
List_bind:function (HTML, JSON) {
Alert ("List binding event")
}
});
Display effect:
Callback ()
Take action after loading data
Example:
var pager = new Pager ({type: "List",
Apidoc_type: $ ('. Txt_type '). attr (' _id '),
Key:text = = _default? "": Text},
{obj: $ ('. Pagediv '),
URL: '/handler/sys/apidoc.ashx ',
Size:10,
Total:10,
Index:1,
}, function (JSON) {
var html = ';
$.each (json.list, function (I, item) {
HTML + = Set_row (item, I);//Set line HTML code
});
var content = $ ('. Con. Content ');
Content.find (' ul '). Remove ();
Content.find (' ol '). After (HTML);
var callback = function () {
$ (' ul Li A.bt_update '). Click (function () {
Alert ("Operations performed after loading data");
})
}
Callback ();
}
});
Display effect:
Encapsulation--Example:
Fun_pager (_url,
{type: "List", Object_type:type, Date:date, Key:key, Task_user: $ ('. Serach_user '). attr (' _id ')},
set_row,{
Del_param: {url: _url},
Callback:function () {
$ (' ul Li A.bt_update '). Click (function () {
Alert ("Operations performed after loading data");
});
}
});
Display effect:
Info_del (items)
Delete a function
Example:
var pager = new Pager ({type: "List",
Apidoc_type: $ ('. Txt_type '). attr (' _id '),
Key:text = = _default? "": Text},
{obj: $ ('. Pagediv '),
URL: '/handler/sys/apidoc.ashx ',
Size:10,
Total:10,
Index:1,
}, function (JSON) {
var html = ';
$.each (json.list, function (I, item) {
HTML + = Set_row (item, i);
});
var content = $ ('. Con. Content ');
Content.find (' ul '). Remove ();
Content.find (' ol '). After (HTML);
var items = new Array ();
Content.find ("ul combox.checked"). each (function () {
Items.push ({
ID: $ (this). Parent (). Parent (). attr (' _id '),
Name: $ (this). Parent (). Siblings ('. Info_title '). Text ()
});
});
var Info_del = function (items) {
Content.find ('. Bt_del '). Click (function () {
Alert ("delete operation");
})
}
Info_del (items);
});
: http://admin.tiaoceng.com/assemblydetail_4.html
JS Paging control