To bootstrap-table pits.

Source: Internet
Author: User

As a result of the design changes, the data from the paging display to the full display (only 3,500 data), the results of Chrome browser page, Firefox browser directly die!

Console.time analysis, unexpectedly is bootstrap-table plug-in pit

There are 2 main questions:

1. Use this. $body [0].html (Html.join (")) to replace the table loaded content. (Average time 900ms)" "

Change to Native method: this. $body [0].innerhtml = Html.join ('); (It takes 250ms to finish the change)

2. The binding event code is the binding that queries all elements first: this. $body. Find (' > Tr[data-index] > td '). Off (' Change '). (Average time 200ms)

Instead, bind directly to the parent element of this. $body: the. $container. Off (' click DblClick '). On (' Click DblClick ', ' Tr[data-index ' > td ', ... (It takes 25ms to finish the change)

To bootstrap-table pits.

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.