1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    10
    Vote Rating
    0
    jarobi is on a distinguished road

      0  

    Default Getting Values from Config

    Is there another way to get the Values. For example:

    A Panel includes 2 Fieldset and each Fieldset has a textarea and displyafield

    Panel (id:'panel')
    ....fieldset ( id :'fieldset1')
    ........textarea1 (id:'txt1')
    .......displayfield1(id: 'd1')
    ...fieldset ( id :'fieldset2')
    .......textarea2 (id:'txt2')
    ......displayfield2 (id: 'd2')

    Ext.getCmp('panel').items.items[0].items.items[0]

    So im getting "textarea1". But i dont want use Indexes and i dont want go directly to the element( Ext.getCmp(txt1)), im searching something like this:
    Ext.getCmp('panel').items.items.get('textarea1').items.items.get('txt1')

  2. #2
    Sencha - Tools Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,424
    Vote Rating
    62
    arthurakay is just really nice arthurakay is just really nice arthurakay is just really nice arthurakay is just really nice arthurakay is just really nice

      0  

    Default

    Use the component query:
    - http://docs.sencha.com/ext-js/4-0/#!...ComponentQuery

    Using getCmp() is not recommended for production code (as it relies on DOM IDs), and "items.items.items[0]" is (1) ugly and (2) unreliable.

    Every component has methods like child(), down() etc. that use the ComponentQuery.

Thread Participants: 1