Results 1 to 3 of 3

Thread: Could we use down and up instead of Ext.get(), Ext.getCmp() and Ext.getComponent ?

  1. #1

    Default Answered: Could we use down and up instead of Ext.get(), Ext.getCmp() and Ext.getComponent ?

    Hi,

    i'm focusing on Sencha touch performance improvement in my mobile hybrid app for android. So i took steps to reduce unnecessary codes and try to reusable same code for some functions. I have doubt in Id and itemId .

    i used Ext.getCmp() function in my code but when i search regarding performance. They said that Ext.getCmp() will reduce app performance. So i consider to use down () and up () methods instead of Ext.getCmp() , Ext.getComponent.query(), Ext.get().

    Could any one help me. either my though is correct or not ?

    thanks in advance

  2. Ext.get will lookup a DOM node via id and has nothing to do with components.
    Ext.getCmp will lookup a component based on id. Issue here is in an application ids can collide without warning. It's recommended not to rely on the id config, only for debugging if all else fails.

    Ext.ComponentQuery.query is like the component's up/down/query/child methods. They use ComponentQuery to resolve component(s) which is much better to use than static ids. The difference here is the up/down/query/child methods start at a point whereas Ext.ComponentQuery.query does not start anywhere and will start resolving components at any level. It is more performant and maintainable to use the up/down/query/child methods.

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Ext.get will lookup a DOM node via id and has nothing to do with components.
    Ext.getCmp will lookup a component based on id. Issue here is in an application ids can collide without warning. It's recommended not to rely on the id config, only for debugging if all else fails.

    Ext.ComponentQuery.query is like the component's up/down/query/child methods. They use ComponentQuery to resolve component(s) which is much better to use than static ids. The difference here is the up/down/query/child methods start at a point whereas Ext.ComponentQuery.query does not start anywhere and will start resolving components at any level. It is more performant and maintainable to use the up/down/query/child methods.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3

    Default

    thanks mitchell,

Similar Threads

  1. Difficulty using/ understanding getComponent, vs. getCmp,etc.
    By grooveyorkcity in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 17 May 2011, 7:58 AM
  2. getComponent
    By discmode in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 15 Mar 2011, 7:46 AM
  3. getComponent question
    By dizor in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 4 Apr 2009, 11:21 PM
  4. getComponent or getItem ??
    By robinet in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 26 Oct 2007, 1:34 AM

Tags for this Thread

Posting Permissions

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