The titlebar class won't hide or show like it says in the sencha docs. I'm initializing it like this
{
xtype: 'titlebar',
docked: 'top',
hidden: true
};
So it starts off hidden. When I set hidden: false
then it does show up. I have it referenced in a button where when the button is pressed it either shows or hides.
bar.show()
and bar.hide()
do not work. Neither does bar.setHidden(true)
or bar.setHidden(false)
. Neither does bar.hidden = true
or bar.hidden = false
. The event handler in my button does work, I have it printing a message when it's pressed.
What's the alternative to get a titlebar to disappear and reappear?
UPDATE
Below is the code for my object and the button listener. Here is a link to the entire class file: http://pastebin.com/tbS35Czk
My settingsbar (this is defined in another class right here: http://pastebin.com/xP5NSrb8)
var settingsbar = {
xtype: 'meterreadings_settingsbar',
docked: 'top',
added: false
};
Here is the button and listener:
{
xtype: 'mbButton',
text: 'Settings',
align: 'right',
listeners: {
tap: function(source, e, eOpts) {
if(!settingsbar.added){
settingsbar.added = true;
Ext.ComponentQuery.query('.meterreadings_main')[0].add(settingsbar);
}
else{
if(settingsbar.hidden){
settingsbar.show();
}
else{
settingsbar.hide();
}
}
}
}
}