PDA

View Full Version : dynamically add panel to viewport east region already one panel present in this.



javapurna
11 Apr 2013, 10:34 PM
hi every one ,

tab panel leaf click open new tab panel .if i am clicking on another leaf previously opened tab panel update with new content . i am open new tab panel but not updated.

var tree= Ext.create('Ext.tree.Panel', {
title: 'New Schedule',
cls:'NewSchedule',
width: 200,
height: 150,
border:false,
store: store,
rootVisible: true,
listeners: {
itemclick: function(view, record, item, index, evt, eOpts) {
var menuId = record.get('id');
alert('menuId'+menuId);
var nodeText = record.get('text');
alert('nodeText'+nodeText);
if (!record.get('leaf')) {
Ext.Msg.alert('Branch clicked', 'You clicked on tree branch: ' + nodeText);
return;
}
var tabPanel = this.up('viewport').down('tabpanel');
var childTab = tabPanel.child('#' + menuId);
alert(childTab);
if (childTab == null) {
childTab = Ext.create('Ext.panel.Panel', {
xtype: 'panel',
bodyPadding: 5,
html: 'This is the ' + nodeText + ' Tab content',
itemId: menuId,
title: nodeText
});

tabPanel.add(childTab);
}
tabPanel.setActiveTab(childTab);
}
},
});

return tree;
},

slemmon
13 Apr 2013, 12:33 PM
Let's have the community continue the conversation in just one thread per issue/question:
http://www.sencha.com/forum/showthread.php?261135