1. #1
    Ext User
    Join Date
    Jan 2009
    Posts
    16
    Vote Rating
    0
    spbroom is on a distinguished road

      0  

    Default Accessing nested items in a form

    Accessing nested items in a form


    Hi, a quick question:

    I have a formPanel that's fairly complex in terms of layout, lots of nested columns tabs etc.

    I am using a factory to return different instances of the form to use in different situations and I want occasionaly to change the title of a tab.

    On simpler forms if I wanted to accessthe items within the form I just used the formPanel.items property and worked from there. Is there an easy way to reference an item that is more deeply nested?

    Thanks for the help.

    Stuart

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    87
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    For FormPanels you can use:
    Code:
    var field = formPanel.getForm().findField('idOrNameOfField');
    (but this only works if the field is already rendered)

  3. #3
    Ext User
    Join Date
    Jan 2009
    Posts
    16
    Vote Rating
    0
    spbroom is on a distinguished road

      0  

    Default


    Thanks, that works great for actual fields in the form. But what about something like a tab title, can I do something similar for that?

    Cheers for the help

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    87
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    For other components you either:
    1. Use itemIds, e.g.
    Code:
    var fieldset = container.getComponent('itemIdOfTabPanel')
      .getComponent('itemIdOfPanel')
      .getComponent('itemIdOfFieldset');
    (drawback: you have to know the container structure at runtime)
    2. Use ids, e.g.
    Code:
    var fieldset = Ext.getCmp('idOfFieldset');
    (drawback: ids need to be unique throughout the page)
    3. Use ref (Ext 3 only), e.g.
    Code:
    {xtype: 'fieldset', ref: '///myfieldset'}
    ...
    var fieldset = container.myfieldset;
    (drawback: you have to know the container structure at designtime)

  5. #5
    Ext User
    Join Date
    Jan 2009
    Posts
    16
    Vote Rating
    0
    spbroom is on a distinguished road

      0  

    Default


    That's what I need. Thanks

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi