Results 1 to 3 of 3

Thread: TabPanel with enableTabScroll and Tab: setTitle

  1. #1
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default TabPanel with enableTabScroll and Tab: setTitle

    hi together,

    imagine a TabPanel with some tabs and the
    Code:
    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:
    Code:
    if (directParent == TabPanel)directParent.delegateUpdates();
    any ideas about this?


    thanks and kind regards,
    tobiu

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default

    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...

  3. #3
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751

    Default

    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •