The laypage front-end paging plug-in implements ajax asynchronous paging and laypageajax

Source: Internet
Author: User

The laypage front-end paging plug-in implements ajax asynchronous paging and laypageajax

In this article, we will share with you the laypage front-end paging plug-in, ajax asynchronous paging, and the ability to retrieve json data without refreshing pagination for your reference. The details are as follows:

Function GetList (pageIndex) {var _ this = "" var clone_this = ""; _ this = $ (". bindDataList "); // data list container, clone_this = _ this. clone (true); var pageSize = 25; // number of entries per page $. ajax ({type: "get", async: false, // asynchronously locked. The default value is true url :".. /ashx/System/DefaultAjax. ashx ", // backend data processing, return the json format data: {" pageIndex ": pageIndex," pageSize ": pageSize,}, contentType:" application/json; charset = UTF-8 ", success: function (data ){ Var json = eval ("(" + data + ")"); if (json. pageCount> 0) // The total number of data entries {_this.html (""); for (var I = 0; I <json. rows. length; I ++) {var html = "<li> json data </li>"; _ this. append (html);} jsonpage (json, pageIndex, pageSize);} else {_this.html (""); _ this. append ("") ;}}) ;}function jsonpage (json, pageIndex, pageSize) {var coun = json. pageCount; // total number of data entries var pagecount = coun % pageSize = 0? Coun/pageSize: coun/pageSize + 1; // calculate the number of pages var laypageindex = laypage ({cont: 'Project _ page', // container. The id, native dom object, and jquery object are supported. Skin: '# fb771f', pages: pagecount, // the total number of pages obtained through the background: curr: pageIndex, // initialize the current page first:' | <', // display the home page as number 1 ,. If it is not displayed, set false to last: '> |', // display the last page as the total number of pages. If not displayed, set false to prev: '<'. // if not displayed, set false to next: '>'. // if not displayed, set false to jump: function (obj, first) {// call back if (! First) {// click the jump page to trigger the function itself, and pass the current page: obj. curr SearchHotTag (obj. curr );}}});}

The above is all the content of this article. I hope you can learn more about the laypage page plug-in. Thank you for reading this article.

Related Article

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.