我有选项卡面板。在选项卡开关(第二个选项卡)有时我想在tab2panel1渲染,有时在tab2panel2基于一些条件。这是我的配置。
{
"xtype" : "tabpanel",
"tabPosition" : "left",
"layout" : "fit",
"tabRotation" : 0.0,
"items" : [
{
"xtype" : "panel",
"title" : "tab1",
"icon" : "classic/resources/images/Profile_active.png",
"layout" : "card",
"items" : [
{
"xtype" : "panel",
"title" : "tab1panel1",
}]
},
{
"xtype" : "panel",
"title" : "tab1",
"icon" : "classic/resources/images/Profile_active.png",
"layout" : "card",
"items" : [
{
"xtype" : "panel",
"title" : "tab2panel1",
},{
"xtype" : "panel",
"title" : "tab2panel1",
}]
},
]
}
这是我正在尝试的,但它正在更改为tab1。而不是tab 2的面板项。
tabchange: function (tab, newTab, oldTab) {
let _this = this,
cardItems = newTab.items;
if (tab.changeValue == true) {
newTab.getLayout().setActiveItem(1);
}
}
但这导致了1的标签。不是标签内的项目。这里有任何帮助。
1条答案
按热度按时间v09wglhw1#
我认为这是错误的地方,更好地听取标签激活事件.类似这样的东西: