1. #1
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Hamburg, Germany
    Posts
    192
    Vote Rating
    6
    winkelmann is on a distinguished road

      0  

    Default ref attribute, what do we do in Ext4? Best Practice?

    ref attribute, what do we do in Ext4? Best Practice?


    In Ext3, we could simply use ref: '../refvarname' do create a reference to a specific component in the parent element/object. From what I can tell, this no longer works in Ext4. So, how exactly do we handle things that previously worked great with ref?

    cheers
    Jan

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,649
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    ComponentQuery.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Hamburg, Germany
    Posts
    192
    Vote Rating
    6
    winkelmann is on a distinguished road

      0  

    Default


    Lets assume i was previously using something like this:
    PHP Code:
    var panel = new Ext.Panel({
    renderToExt.getBody(),
      
    items: [{
        
    title'Subpanel',
        
    ref'../subPanel'
      
    }]
    }); 
    I could simply access the subPanel via panel.subPanel. I do get, that I could use panel.query('panel')[0] ti access the respective panel. But what if I have like 10 subpanels? Do I have set IDs? I don't like setting custom IDs :-)

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,649
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    the simplest way is to use itemId,
    Code:
    itemId : 'sub1'
    then use
    Code:
    panel.down('#sub1')
    if you have a special xtype, use the xtype for the query, or if you have button with an action, use
    Code:
    panel.down('button[action=youraction]')
    you see, you have a lot more possibilities.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Hamburg, Germany
    Posts
    192
    Vote Rating
    6
    winkelmann is on a distinguished road

      0  

    Default


    Wow, this is wicked! I guess itemId went by me completely. I was used to having direct element references like in a Java App, but this rocks. Thx for that!

Similar Threads

  1. I18n in Ext4
    By Animal in forum Community Discussion
    Replies: 17
    Last Post: 28 Aug 2013, 3:20 AM
  2. Ext4 forums
    By steffenk in forum Community Discussion
    Replies: 13
    Last Post: 19 Apr 2011, 2:21 PM
  3. Ext4 BUGS
    By IntelligentCode in forum Ext:Bugs
    Replies: 0
    Last Post: 23 Mar 2011, 10:41 PM
  4. Ext4, when?
    By westy in forum Community Discussion
    Replies: 31
    Last Post: 15 Dec 2010, 6:49 AM
  5. Replies: 0
    Last Post: 1 Nov 2009, 8:10 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar