-
27 Sep 2012 7:11 AM #11
The code you listed says
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.Code:var tab = Ext.ComponentQuery.query('viewport > panel'); console.log(tab);
-
27 Sep 2012 7:23 AM #12
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
-
27 Sep 2012 7:27 AM #13
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();
-
27 Sep 2012 7:28 AM #14
You did it Tim!

The 1 million dolars answer was:
Thanks to Scott too.Code:var query = Ext.ComponentQuery.query('#tabCenter'); tabPanel = query[0]; newTab = tabPanel.add({ title: 'Test', html: 'test test test' }).show();



Reply With Quote