jquery Plugin Easyui Setting the pagenumber of the DataGrid results in a two-time request problem resolution _jquery

Source: Internet
Author: User

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.

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.