- mainTabs = Ext.create('Ext.tab.Panel',{
- .......
- });
- function addTab(node) { //record.raw存储树节点相应信息
- var panel = node.raw.itemid;
- var tab = mainTabs.add(panel);
- tab.setHeight(mainTabs.getHeight() - mainTabs.tabBar.getHeight()); //解决高度自适应问题,搞得很痛苦啊
- tab.show();
- }
- tree.on("itemclick",function(view,record){ //要用itemclick来获取click行为, view与record获取树节点
- addTab(record)
- });
转载于:https://blog.51cto.com/wangronghao/859846