JS Paging control

Source: Internet
Author: User

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)
      1. Config
      2. Page
      3. Fun_load
      4. Fun_error
      5. Is_cookie
      6. HTML code
      7. List_bind (HTML, JSON)
      8. Callback ()
      9. Info_del (items)
      10. Button_active ()
      11. 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

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.