Extjs tips: Big Data Grid for Data removal and addition Efficiency Optimization

Source: Internet
Author: User

Reasons for slowness:

Because each time a piece of data is removed from the store, the grid will be re-painted. When the data volume is large, it takes a long time, for example, it may take about 2 seconds to remove one of the 1500 grids. It takes more than 10 seconds to remove 10 grid entries and 800 grid entries. Google's browser is suspected of crash.

Solution:

1. Disable ext re-painting first, and resume the re-painting function after deletion,CodeAs follows:

 
Ext. suspendlayouts (); store. Remove (selection); Ext. resumelayouts (true );

2. First, disable the store event. After processing is complete, recover the event and then re-specify the store to the grid. The Code is as follows:
Store. suspendevents ();
Store. Remove (selection );
Store. resumeevents (); grid. reconfigure (store );

3. Combination of the two
Ext. suspendlayouts ();
store. suspendevents ();
store. remove (selection);
store. resumeevents ();
grid. reconfigure (store);
Ext. resumelayouts (true);

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.