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.