누군가가이 문제에 도움이된다면 고맙겠습니다. 노드를 클릭하면 탭을 탭 패널에로드하는 트리 패널이 있습니다.Ext JS 탭 패널 - 동적 탭 - 탭이 작동하지 않음
탭이 제대로로드되지만 문제가 중복됩니다. Tab 패널에 추가하기 전에 탭이 있는지 확인해야합니다. 나는이 문제를 해결할 것 같지 않고 내 두뇌를 먹고있다. 이것은 꽤 간단하고 솔루션에 대한 stackoverflow 및 EXT JS 포럼을 확인했지만 그들은 나를 위해 작동하지 않는 것 또는 나는 장님이되고있다.
이 나무에 대한 내 코드입니다 :
var opstree = new Ext.tree.TreePanel({ renderTo: 'opstree', border:false, width: 250, height: 'auto', useArrows: false, animate: true, autoScroll: true, dataUrl: 'libs/tree-data.json', root: { nodeType: 'async', text: 'Tool Actions' }, listeners: { render: function() { this.getRootNode().expand(); } } }) opstree.on('click', function(n){ var sn = this.selModel.selNode || {}; // selNode is null on initial selection renderPage(n.id); }); function renderPage(tabId) { var TabPanel = Ext.getCmp('content-tab-panel'); var tab = TabPanel.getItem(tabId); //Ext.MessageBox.alert('TabGet',tab); if(tab){ TabPanel.setActiveTab(tabId); } else{ TabPanel.add({ title: tabId, html: 'Tab Body ' + (tabId) + '
', closable:true }).show(); TabPanel.doLayout(); } } });
는 이것은 탭 패널
new Ext.TabPanel({
id:'content-tab-panel',
region: 'center',
deferredRender: false,
enableTabScroll:true,
activeTab: 0,
items: [{
contentEl: 'about',
title: 'About the Billing Ops Application',
closable: true,
autoScroll: true,
margins: '0 0 0 0'
},{
contentEl: 'welcomescreen',
title: 'PBRT Application Home',
closable: false,
autoScroll: true,
margins: '0 0 0 0'
}]
})
누군가가 도와 주실 수 코드입니다?
나는 눈이 멀었다. 생성 된 탭의 ID로 노드 ID를 추가했다고 생각했지만 그렇지 않았습니다. Jonathan을 지적 해 주셔서 감사합니다. 그것은 나를 위해 일했습니다. –