文件名称:tree with tab
文件大小:618KB
文件格式:RAR
更新时间:2017-07-27 11:07:59
extjs tree with tab
extjs 左边窗口treepanel 菜单与右边窗口tabpanel 交互 var westPanel = Ext.create('Ext.tree.Panel', { title : '菜单', region : 'west', margins : '0 5 0 0', width : 200, store : store1, rootVisible : false, listeners : { itemclick : function(tree, record, item, index, e, options) { var nodeText = record.data.text; var tabPanel = viewport.items.get(1); var tabBar = tabPanel.getTabBar(); for ( var i = 0; i < tabBar.items.length; i++) { if (tabBar.items.get(i).getText() === nodeText) { var tabIndex = i; } } if (Ext.isEmpty(tabIndex)) { tabPanel.add({ title : record.data.text, bodyPadding : 10, closable: true , html : record.data.text }); tabIndex = tabPanel.items.length - 1; } tabPanel.setActiveTab(tabIndex); } } });