PDA

View Full Version : TabPanel with enableTabScroll and Tab: setTitle



tobiu
13 Oct 2009, 7:29 AM
hi together,

imagine a TabPanel with some tabs and the

enableTabScroll:true
config.

when changing the title of a tab, the size of the tabHeader can change.
example: changing "tab title" to "a very very long tab title".

i am searching for a general solution, that should IMHO be implemented in the setTitle-method of a Panel.

Something like:

if (directParent == TabPanel)directParent.delegateUpdates();

any ideas about this?


thanks and kind regards,
tobiu

tobiu
13 Oct 2009, 7:41 AM
ok, it seems a bit more difficult, because the setTitle-method is used internally for the creation of each title.

the directParent.delegateUpdates(); should not be fired for the creation of elements...

tobiu
13 Oct 2009, 7:52 AM
Ext.override(Ext.Panel, {
setTabTitle : function(title, iconCls){
this.title = title;
if(this.header && this.headerAsText){
this.header.child('span').update(title);
}
if(iconCls){
this.setIconClass(iconCls);
}
this.fireEvent('titlechange', this, title);

this.ownerCt.delegateUpdates();
return this;
}
});


this is a sort of workaround.
i added a method doing the same as setTitle for tabs.
so, i have to replace all calls to tabs in my code manually.
better solutions are welcome!

kind regards,
tobiu