[英]Activating tabs in a tab panel without accessing it extjs4.2
I created a tabpanel that has in it two tabs panel_A and panel_B. 我创建了一个选项卡面板,其中有两个选项卡panel_A和panel_B。 When the tabpanel opened, only A is active, and B is not, unless you access it.
打开选项卡面板时,只有A处于活动状态,而B则没有活动,除非您对其进行访问。 How can i make both tabs active without having to access each item to get it active.
我如何才能使两个选项卡都处于活动状态而不必访问每个项目才能使其处于活动状态。 Any help please?
有什么帮助吗?
tabPanel = Ext.create('Ext.tab.Panel', {
id: 'tabpanel',
region: 'center',
activeTab: 0,
border:false,
split:true,
autoScroll: true,
tbar: [{
xtype: 'button',
deferredRender : false,
handler:function(){
save();
}
}],
items: [
{
id:"panel_A",
html: "<iframe src= '"+A_url +"' width='100%' height='100%' id='frm_A' name='frm_A' frameborder=0 />",
},{
id:"panel_B",
html: "<iframe src='"+B_url+"' width='100%' height='100%' id='frm_B' name='frm_B' frameborder=0 />",
}
],
renderTo: Ext.getBody()
});
If you just want to activate all tabs in your panel one by one (idk why you want to do this) you can do something like: 如果只想一一激活面板中的所有选项卡(这就是为什么要这样做),则可以执行以下操作:
for(var i = 0; i < tabPanel.items.items.length; ++i) {
tabPanel.setActiveTab(i);
}
If if you want to active all tabs (both in your example) at the same time I think its not possible. 如果您想同时激活所有选项卡(在您的示例中都是) ,那么我认为这是不可能的。
If you want to activate certain tabs by what criterion we can choose this tabs? 如果您想通过什么标准激活某些选项卡,我们可以选择该选项卡?
Here is simple fiddle , update it if you want to clarify your problem. 这是简单的小提琴 ,如果您想澄清问题,请对其进行更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.