我想动态再我的布局中添加一些组件,但是无法显示出来,后来在网上查了一下是要调用一下doLayout(),但是还是没有用。
[b]问题补充:[/b]
对我的布局就是border布局,我想动态添加west
Notes:
* Any container using the BorderLayout must have a child item with region:'center'. The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout.
* Any child items with a region of west or east must have width defined (an integer representing the number of pixels that the region should take up).
* Any child items with a region of north or south must have height defined.
* The regions of a BorderLayout are fixed at render time and thereafter, its child Components may not be removed or added. To add/remove Components within a BorderLayout, have them wrapped by an additional Container which is directly managed by the BorderLayout. If the region is to be collapsible, the Container used directly by the BorderLayout manager should be a Panel. In the following example a Container (an Ext.Panel) is added to the west region:
这个是原文,大意就是border布局不能够动态增加和删除子组件,建议你先把你不想看到的部分折叠起来.这样比较好
你的布局是什么呢?有些布局是不能动态增加删除组件的
一般很少会手动调用doLayout
把你的代码贴出来吧.
应该是你的布局的问题.
嗯border是不允许动态添加item的,你可以在初始化的时候在东西南北的方向各给它一个空的panel(不设高度可宽度和title就不会显示出来),然后给这个panel添加item,再调用这个panel的doLayout方法就行啦