How to Show/Hide/Toggle Element with ExtJS?
15
votes
2 Answers
30
votes
Very straightforward, at the element level (further to the comments below):
Ext.get("my-div");
Where my-div
is the id of the element in question.
At the component level:
Ext.getCmp('idofthecomponent').getEl().show();
Ext.getCmp('idofthecomponent').getEl().hide();
Ext.getCmp('idofthecomponent').getEl().toggle();
See here (show), here (hide) and here (toggle) respectively. So 'idofthecomponent' would be, say the id assigned to a Panel object.
You can also refer to the element directly using other selectors, such as document.getElementbyId, eg.
document.getElementById('elementtoshow').show();