I have a window in which I am rendering a number of ponents like panels etc.
Is there a way I can hide all the ponents contained in window without having to hide them individually? Something like,
Ext.getComponent('myWindow').hideAllComponents();
I am using extjs 3.4.
I have a window in which I am rendering a number of ponents like panels etc.
Is there a way I can hide all the ponents contained in window without having to hide them individually? Something like,
Ext.getComponent('myWindow').hideAllComponents();
I am using extjs 3.4.
Share Improve this question asked Jun 26, 2013 at 7:35 Pratik PatelPratik Patel 1,3553 gold badges17 silver badges45 bronze badges 1- why not make all ponents in a container and then hide it. – Aminesrine Commented Jun 26, 2013 at 10:20
3 Answers
Reset to default 2If I understood you right, you do not want to hide your window, but the elements in your window. So can do this:
// get window, get element, get all direct children with css selector '*'
var children = Ext.get('myWindow').getEl().down('*')
// hide them all
Ext.each(children,function(child){child.hide();});
Try setting style for your container
Ext.get('myWindow').setStyle('display','none');
Assuming myWindow
is a reference to your window, you can use:
Ext.each(myWindow.items.items, function(cmp) { cmp.hide(); });
The other answers mention Ext.get but that retrieves DOM elements, not ponents.
See also: ExtJS hide all child ponents