PDA

View Full Version : How dynamically change accordion item title?



headroot
23 Jul 2009, 4:21 AM
I have the code:

new Ext.TabPanel({
border: false,
activeTab: 0,
tabPosition: 'top',
items: [{
contentEl:'el1',
border: false,
layout:'accordion',
title: 'tab1',
layoutConfig:{animate:true},
items:[{
id:'aaa',
title:'item1',
border:false,
contentEl: 'el2',
iconCls:'settings',
},
{
title:'item2',
border:false,
contentEl: 'el3',
iconCls:'settings'
}
]},
{
contentEl:'el5',
border: false,
layout:'accordion',
title: 'tab2',
layoutConfig:{animate:true},
items:[{
id:'aaa',
title:'item3',
border:false,
contentEl: 'el6',
iconCls:'settings',
},
{
title:'item4',
border:false,
contentEl: 'el7',
iconCls:'settings',
}
{
title:'item5',
border:false,
contentEl: 'el8',
iconCls:'settings'
}
]}]})

I found one way -->


Ext.get('aaa').dom.firstElementChild.textContent='dasdasdas';but this change look item icon too...(( And this possible only when I open tab2 and after this only code change title.... Because tab2 is not active direct.... Therefore this bad idea...

I looking for this solution arround the forum... but not find how change title correctly?

Condor
23 Jul 2009, 4:27 AM
Ext.getCmp('aaa').setTitle('dasdasdas');

headroot
23 Jul 2009, 4:28 AM
thanx, provided to be a simple thing....

andycramb
23 Jul 2009, 4:28 AM
Have you tried?


Ext.getCmp('aaa').setTitle('myNewTitle');