Results 1 to 3 of 3

Thread: Problem with function setVisible

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Metz, France
    Posts
    60
    Vote Rating
    2
      0  

    Default Problem with function setVisible

    Hello, I want to hide/show a container which contains fieldset and comboBox when I choose a radio button. I do that :

    Code:
    var first = {
            xtype: 'container',
            layout: 'hbox',
            margin: '0 0 10',
            items: [{
                xtype: 'fieldset',
                flex: 1,
                title: 'Choice',
    			height:150,
                defaultType: 'radio',
        
                items: [{
    				checked:true,
    				boxLabel: 'Root',
                    name: 'choice',
    				id:'root',
                    inputValue: 'root'
                }, {
    				boxLabel: 'Participant',
                    name: 'choice',
    				id:'participant',
                    inputValue: 'participant',
    				handler: function() {
    					second.setVisible(true);
    				}	
                }]
            }]
    };
    
    var second = {
            xtype: 'container',
            layout: 'hbox',
            margin: '0 0 10',
            hidden:true,
            items: [{
                xtype: 'fieldset',
    			height:300,
                title: 'Selection',
    			defaultType:'combo',
                items:[{
    				fieldLabel:'Field 1',
    				displayField: 'field1',
    				store:store1
    			},
    			{
    				fieldLabel:'Field 2',
    				displayField: 'fileld2',
    				store:store2
    			},
    			{
    				fieldLabel:'Field 3',
    				displayField: 'field3',
    				store:store3
    			},
    			{
    				fieldLabel:'Field 4',
    				displayField: 'field4',
    				store:store4
    			},
    			{
    				fieldLabel:'Field 5',
    				displayField: 'field5',
    				store:store4
    			},
    			{
    				fieldLabel:'Field 6',
    				displayField: 'field6',
    				store:store5
    			}]	
            }]
        };
    But it doesn't work, Firebug told me that 'second.getVisible is not a function'.

    Thank for your help !

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,381
    Answers
    3997
    Vote Rating
    1536
      0  

    Default

    That's because second is an Object not a component. You need to resolve the actual instance.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Metz, France
    Posts
    60
    Vote Rating
    2
      0  

    Default

    Ok it's good, thank you I do that :

    Code:
    var second = Ext.create('Ext.container.Container', {
            layout: {
                type: 'hbox'
            },
    But now, the function setVisible(false) hide my container but the function setVisible(true) don't show other container. Do you know why ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •