1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010
    Location
    Columbia, MD, USA
    Posts
    147
    Vote Rating
    0
    msmolyak is on a distinguished road

      0  

    Default Referencing child components in ExtJS 4

    Referencing child components in ExtJS 4


    ExtJS 3 introduced a 'ref' attribute allowing the code to refer to the child components (nested at any level) of a given component using simple dot notation.

    I am trying migrate the ExtJS 3 code that uses this technique to ExtJS 4 and getting errors stating that the child component is not defined. I checked the API documentation and was not able to find any trace of 'ref' attribute.

    What happened to it? What is the proper way of referencing child components in ExtJS 4?

    Michael

  2. #2

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    7
    jack.slocum will become famous soon enough

      0  

    Default


    ref was removed in Ext 4? Why?
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,170
    Vote Rating
    33
    jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice jay@moduscreate.com is just really nice

      0  

    Default


    Ref has limitations that proper component query usage overcomes.

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    7
    jack.slocum will become famous soon enough

      3  

    Default


    ??

    The ref functionality should have been kept. However, it should have been modified to use component selectors/query instead of it's own syntax.

    I put ref in the framework for a purpose, to automate the process of looking up child components, instead of manually querying. "proper component query usage" doesn't address or apply to that at all. Why would anyone want to write a whole line of query code to get a reference that could have been automatic. In a real app, ref can save you 100s of lines of code. I used it religiously in every app I wrote with Ext 3.
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

Similar Threads

  1. Referencing components
    By jschwartzbeck in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 1 Nov 2010, 10:07 AM
  2. Referencing components in containers
    By dlipski in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 13 Nov 2009, 7:41 AM
  3. Replies: 2
    Last Post: 7 Aug 2009, 4:46 PM
  4. Referencing body of a child item when extending a container
    By elishnevsky in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 6 Aug 2009, 12:08 PM

Tags for this Thread