Results 1 to 2 of 2

Thread: removeAll() vs removeAll(true) perf?

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Paris, France
    Vote Rating

    Default removeAll() vs removeAll(true) perf?

    Basically, i just want to understand when it can be considered useful to/not-to destroy elements with the true parameter. In my app, if I updateWithRecord() a form and need to build it there (dynamic structure), so first i have to clear previous built form :

    Considering that I can have a 10-item list (not a fixed-number but quite low) that will be rendered on itemtap as different forms (like one with dates, one with dates and textfields)... Should I destroy old elements with removeAll(true) when a new form has to be rendered? I'm trying to get the best perf.

    There may be a lot of comings-and-goings. If i do not destroy, will they stack somewhere a overflow memory at some point??!

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    If you want to reuse a component and keep it's state (data in form fields of a remove form or selection in a list) then not destroying the component could be used. There is of course ways around this to recreate a component.

    Reusing isn't bad even if you have different uses for them. Creating new components does have a small perf hit so if you just want to update HTML then you could keep a component around and just update it's html.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts