Hybrid View

  1. #1
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default Referencing some items each other

    Referencing some items each other


    Hi everyone!

    I've got 2 items in a FormPanel. First one is a radiogroup, second one is an Extended TabPanel.

    I'm trying to modify some properties of the TabPanel depending the value of the radiogroup.

    I've been thinking about it and i've coded this:
    Code:
    var f = new Ext.FormPanel({
        ...
        items:[{
            ...
        },{
            xtype: 'radiogroup',
            hideLabel: true,
            itemCls: 'x-check-group-alt',
            vertical: true,
            name: 'ro',
            columns: 1,
            items:[{
                ...
            }]
        },{
            ...
        },{
            xtype: 'tabPanelFianzas',
            radio: f.getForm().findfield('ro')
        },{
            ...
        }]
    And trying to handle the value of 'ro' in my extended tabPanelFianzas.

    Is it anyway to do it? is it the correct way? I'm tring to avoid the use of Ext.getCmp().

    f is undefined like that, and i've been trying with "this" and is window.document.

    Thanks in advance!
    People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!

  2. #2
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246
    Vote Rating
    2
    laurentParis is on a distinguished road

      0  

    Default


    Your form (f) is not rendered when your code trying affect f.getForm()... to property 'radio'
    PHP Code:
    {
      
    xtype'tabPanelFianzas',
      
    getRadio: function () {
        var 
    radio Ext.getCmp('myFormId').getForm().findfield('ro');
        return function () {
          return 
    radio;
        }
      }


  3. #3
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default


    Oh! Thanks! i get it.

    Now, is there any way to change some properties of the extended TabPanel if i handle the radiogroup without changing the radiogroup code?

    Thanks!!
    People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!

  4. #4
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246
    Vote Rating
    2
    laurentParis is on a distinguished road

      0  

    Default


    PHP Code:
    {
      
    xtype'tabPanelFianzas',
      
    getRadio: function () {
        var 
    radio Ext.getCmp('myFormId').getForm().findfield('ro');
        return function () {
          return 
    radio;
        }
      },
      
    listeners: {
        
    render: function (cmp) {
          var 
    radio cmp.getRadio();
          
    radio.on('change', function (radioGroup,radioChecked) {
            if(....) {
              
    cmp.hide(); // cmp is your tabPanelFianzas
            
    }
            else {
              
    cmp.show();
            }
          };
        }
      }

    but it will be more easiest to start with radiogroup
    PHP Code:
    {
      
    xtype'radiogroup',
      
    hideLabeltrue,
      
    itemCls'x-check-group-alt',
      
    verticaltrue,
      
    name'ro',
      
    columns1,
      
    items:[{
        ...
      }],
      
    listeners: {
        
    change: function (radioGroupradioChecked) {
          var 
    tabpanel Ext.getCmp('myTabPanelFianzas');
          if(....) {
            
    tabpanel.hide();
          }
          else {
            
    tabpanel.show();
          }
        }
      }
    }
    ..
    {
      
    xtype'tabPanelFianzas',
      
    id'myTabPanelFianzas'


  5. #5
    Sencha User attu's Avatar
    Join Date
    Aug 2008
    Location
    Madrid, Spain
    Posts
    95
    Vote Rating
    0
    attu is on a distinguished road

      0  

    Default


    Yeah! I'm really close to the solution!!

    Thank you so much!!
    People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!

Similar Threads

  1. Referencing components in containers
    By dlipski in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 13 Nov 2009, 7:41 AM
  2. Replies: 2
    Last Post: 7 Aug 2009, 4:46 PM
  3. Referencing Form Elements
    By iwarner in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 29 Apr 2009, 2:16 AM
  4. Referencing form items
    By Efex in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 May 2008, 4:24 PM

Thread Participants: 1