Results 1 to 3 of 3

Thread: How to manage Unused Dom and Objects

  1. #1
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default How to manage Unused Dom and Objects

    Hi,

    Just need some guidance while approaching a Project Using Sencha.

    Basically the App will have Many Panels and SubPanels.

    For examples I have two Main Panels A and B

    where A have 10 items (Panel) and B have 12 items.

    While some panel layouts are shared by both A and B
    so i made it as a function
    Code:
    var subpanFunc = function (id,title){
     if(Ext.getCmp(id)){
         return  Ext.getCmp(id);
      }
      var subpan = new Ext.Panel({
           id:id,
           title:'title
           items:[
              // this may be a list with users
              ]
       });
      return subpan;
    }
    So if i make two calls like
    Code:
    var sub1,sub2;
    
    sub1=  subpanFunc('sub1','sub1');
    sub2=  subpanFunc('sub2','sub2');
    Code:
    mainpanelA.setActiveItem(sub1);
    mainpanelB.setActiveItem(sub2);
    I have two instance of same panel and sub1 with be item of A and sub2 that of B;

    while im not accessing B , i will destroy all items of B to free the Dom.
    But the variables to which i have assigned the panels will be still there.
    ie sub2 will be having all the objects.

    Then i will have to manualy set
    Code:
    sub2 = {}

    So what i'm trying to ask is

    will those objects make App Slow ?
    Is there a better way to approach this ?

    Hope someone could help me with this.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,144
    Vote Rating
    985
      0  

    Default

    Don't prematurely optimize. I don't see you having much of a problem.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default

    Thanks for the reply

    The scenario i faced was while working with Kitchen Sink. As it contained many panels and subpanel, orientation in Iphone became bit slow(it takes time to adjust whole Layout). At the same time there are many unused panels also. So i destroyed the unused elements.

    Is it supposed to make the app bit fast?

Similar Threads

  1. How to change DOM objects?
    By kovomaster in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 27 Jul 2009, 4:20 AM
  2. [2.1] Ext::Window, Unused code - Minor
    By evant in forum Ext 2.x: Bugs
    Replies: 0
    Last Post: 16 Jun 2008, 4:05 AM
  3. [2.0][OPEN] DatePicker's constrainToViewport unused
    By sjivan in forum Ext 2.x: Bugs
    Replies: 4
    Last Post: 11 May 2008, 11:52 PM
  4. Unused call and optimisation in GridView.js
    By perrich in forum Ext 1.x: Bugs
    Replies: 0
    Last Post: 4 Jun 2007, 10:45 AM

Posting Permissions

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