Clay Banks
Clay Banks

Reputation: 4591

Simply showing a component Only if another component is showing - Ext JS

So I have a hidden container item:

id: 'category_search', hidden: true, ...

And another hidden panel:

{ xtype: 'panel', id: 'mylist', hidden: true ...

Here i have a controller to show category search ONLY when mylist is Not hidden - handled by the click of a button categorized_search:

catSearch: function() {
    var grid = Ext.getCmp('mylist');
    if(grid.isHidden){ //checking to see if the component is hidden
        console.log('Please enter a search');
    }
    else
    {       
        Ext.getCmp('category_search').show(); //Shows category search
    }
}

When I click my categorized_search button, it does not display when mylist is showing, and will display when mylist is not showing. How can I fix this?

Cheers!

Upvotes: 0

Views: 54

Answers (1)

kevhender
kevhender

Reputation: 4405

AbstractComponent.isHidden() and AbstractComponent.isVisible() are functions, not properties. Add parentheses to your if statement.

http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.AbstractComponent-method-isHidden

Upvotes: 2

Related Questions