1. #11
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    570
    Vote Rating
    181
    Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold

      0  

    Default


    Quote Originally Posted by brunoflmg View Post
    The Firebug says that is a object. From console.log(tab):

    Attachment 38994
    The code you listed says
    Code:
    var tab = Ext.ComponentQuery.query('viewport > panel'); console.log(tab);
    ComponentQuery.query returns an array of components that match your selector. The above code you posted will return an array. You have to grab the component you want out of it. My Guess is that you are clicking on the tabpanel in the array and then printscreening it. If that was a screen of a console log it wouldn't be in the dom tab.

  2. #12
    Sencha User
    Join Date
    Sep 2008
    Location
    Brasil
    Posts
    21
    Vote Rating
    0
    brunoflmg is on a distinguished road

      0  

    Default


    The code above is sufficient to get the tabPanel object, but the problem is when I try to add the new tab after the layout (viewport) already rendered. Like I say before... When I click in insert button in my grid, then this new tab must be opened in my tabPanel.

    console.png
    _______
    Regards,
    Bruno Leite
    http://kinzaa.com/brunoleite

  3. #13
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    570
    Vote Rating
    181
    Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold Tim Toady is a splendid one to behold

      0  

    Default


    Those brackets mean it is an array. The add method exists on the tabpanel. If add doesn't work, you are not running it on the tabpanel.

    Try
    Code:
    var tabPanel = Ext.ComponentQuery.query('#tabCenter').pop();

  4. #14
    Sencha User
    Join Date
    Sep 2008
    Location
    Brasil
    Posts
    21
    Vote Rating
    0
    brunoflmg is on a distinguished road

      0  

    Default


    You did it Tim!



    The 1 million dolars answer was:

    Code:
    var query = Ext.ComponentQuery.query('#tabCenter');
    tabPanel = query[0];
    newTab = tabPanel.add({
          title: 'Test',
          html: 'test test test'
    }).show();
    Thanks to Scott too.
    _______
    Regards,
    Bruno Leite
    http://kinzaa.com/brunoleite

Thread Participants: 2

Tags for this Thread