Ext js - 在TabPanel中动态更改Tab的内容 [英] Ext js - Dynamically changing content of Tab in a TabPanel

查看:141
本文介绍了Ext js - 在TabPanel中动态更改Tab的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个(Ext JS)选项卡面板,其中隐藏的选项卡在初始实例化时根本不加载,(我唯一设置的是标题)。

I have an (Ext JS) tab panel where the hidden tabs aren't loaded at all upon initial instantiation, (the only thing I set is the title).

在激活一个选项卡时,我想调用一个方法,然后设置一个新的FormPanel / GridPanel并将该内容放入选项卡。

Upon 'activation' of a tab I want to call a method , which then instanstiates a new FormPanel/GridPanel and put this content into the tab.

有人可以指出我的代码示例或给我提示如何做到这一点?
非常感谢!

Can someone point me to a code example or give me tips on how to do this?? Thanks so much!

推荐答案

只需构建一个新面板并将其添加到激活的选项卡。然后调用doLayout()。

Just build a new panel and add it to the activated tab. Then call doLayout().

listeners: {
    activate: function(panel) {
        var formPanel = ....
        panel.add(formPanel);
        panel.doLayout();
    }
}

这篇关于Ext js - 在TabPanel中动态更改Tab的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆