This article illustrates the solution of the jquery plug-in Easyui setting the pagenumber of the DataGrid to cause two requests. Share to everyone for your reference, specific as follows:
First, the problem description:
$ (' #tb-page-list '). DataGrid ({
URL: '/bisorderinfo/getlist ',
pagenumber:2,
pagesize:10
});
When the manual setting pagenumber is greater than or equal to 2 o'clock, the requested method is requested 2 times, and the second pagenumber equals 1;
Second, the reason lies in:
7821-7828 lines of code in the Jquery.easyui.min.js 1.3.4;
Because the paging control initializes the parameter total = 0, pagenumber = 1, the first request second page parameter is inconsistent with the control initialization parameter, causing the request again: _5DC (_545);
Solution: When the page is refreshed, the total number of requested data changes and the Pagebar display needs to be updated.
Third, the solution:
7822 Lines (Please note the version 1.3.4 Jquery.easyui.min.js):
_54a.pagination ("Refresh", {total:data.total});
Modified to:
Copy Code code as follows:
_54a.pagination ("Refresh", {pagenumber:opts.pagenumber| | _54b.pagenumber,total:data.total});
More interested readers of jquery-related content can view the site topics: "jquery Extended Tips," "jquery common Plug-ins and Usage summary", "jquery drag-and-drop effects and tips summary", "jquery table (table) Operation Tips Summary", " A summary of Ajax usage in jquery, a summary of common classic effects in jquery, a summary of jquery animation and special effects usage, and a summary of jquery selector usage
I hope this article will help you with the jquery program design.