我希望在用户点击了一个tabpanel中的tab,其实是个formpanel中的按钮后,可以将这个formpanel上所有的构件都隐藏起来,然后在这个tab 里显示另一个formpanel,完成某个工作后,再返回显示原来的那个formpanel。应该调用什么函数?
我试了add,可以增加另一个formpanel,但原先的还在。用update?也加载不上.
[quote]将这个formpanel上所有的构件都隐藏起来,然后在这个tab 里显示另一个formpanel,完成某个工作后,再返回显示原来的那个formpanel[/quote]
解决办法:
1.首先建议你选择正确的方式,通过布局来解决这个问题,你可以去官网看看cardlayout布局的示例,我的[url=http://yourgame.iteye.com/blog/252853]图书管理系统[/url]也采用此布局方式.
2.你点击按钮的时候,要隐藏的容器.hide();要显示的容器.show(),处理完之后再反过来调用.
remove( Component/String component, [Boolean autoDestroy] ) : Ext.Component
Removes a component from this container. Fires the beforeremove event before removing, then fires the remove event after the component has been removed.
Parameters:
component : Component/String
The component reference or id to remove.
autoDestroy : Boolean
(optional) True to automatically invoke the removed Component's Ext.Component.destroy function. Defaults to the value of this Container's autoDestroy config.
Returns:
Ext.Component
component The Component that was removed.
如果你是想让客户分步操作,那可以考虑在tab里面放个CardLayout布局的panel,然后再放那几个formpanel.