最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ExtJS. Hide all components within a container - Stack Overflow

programmeradmin2浏览0评论

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
Add a ment  | 

3 Answers 3

Reset to default 2

If 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

发布评论

评论列表(0)

  1. 暂无评论