Abhimanue Tamang
Abhimanue Tamang

Reputation: 580

sencha touch hide and show a component on tab of a button

I have created an app with some views and also there is a list button on the top left corner to display and hide list on tap event. some how I am able to hide it on tab but don't know how to display it again. By default it should be hidden but on tap of that button it should hide and show it self depending on current property.

iconCls: 'list',
iconMask: true,
ui: 'plain',
handler: function() {
        Ext.getCmp('ext-ListNavigation-1').hide();
            }

And list view code

Ext.define('ov_app.store.NavigationItems', {
    extend: 'Ext.data.Store',
config:{
    model: 'ov_app.model.Items', 
    data:[
        { items:"Services"},
        { items:"Solutions"},
        { items:"About Us"},
        { items:"Why Singapore"},
        { items:"Contact Us"}
    ]
}
});

the user inter phase looks something like this enter image description here

As you can see i what to hide and show this (services,solution, etc.. ) on tap of the list button above the list.

Upvotes: 2

Views: 3846

Answers (1)

sha
sha

Reputation: 17860

var list = Ext.getCmp('ext-ListNavigation-1');

if (list.isHidden()) {
  list.show();
}
else {
  list.hide();
}

Upvotes: 3

Related Questions