Results 1 to 1 of 1

Thread: Setting the tab title for a pre-existing Component instance

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Seattle, WA
    Vote Rating

    Question Setting the tab title for a pre-existing Component instance

    Hello all,

    I wonder if anyone could point out what's wrong with this code. I have an existing Ext.Component instance that I want to add to a TabPanel, and I don't know how to set the title on it.

    I have seen a lot of conflicting information both on these forums and on the Internet in general. I am using the most recent downloadable version of Sencha Touch.

    Here is the code. It currently shows the new tab, but with a blank title. If I use either of the setText() calls, or try to call setTitle() in some way that I've seen on some other threads, the script halts execution.

    newPage is a Ext.Component instance (in fact, for this particular test, it's another TabPanel instance):

    var tab = tabPanel.add( newPage );
                //tab.setText( title );
                //newPage.setText( title );
                if ( show ) {
                    tabPanel.setActiveItem( newPageIdx );
    Does anyone know how I can successfully set and show the title?

    -Nathan Morse
    Last edited by morsen; 13 Aug 2011 at 5:31 PM. Reason: Wrap [CODE] tags

Tags for this Thread

Posting Permissions

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