PDA

View Full Version : I need activate the last tab in tabpanel in EXTJS 4.2.1



eliecerSR
12 Mar 2014, 12:48 PM
I need activate the last tab in tabpanel. I have a button that adds new tabs and I need to change the last added.

JIMECKELS
12 Mar 2014, 7:52 PM
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.tab.Panel-method-setActiveTab

Not sure if there's something odd about your requirement, or just didnt know about this function.

eliecerSR
19 Mar 2014, 10:19 AM
You can get the length of the items array and setActiveTab using that.


var last = tabPanel.items.length -1;
tabPanel.setActiveTab(last)

Here is fiddle (https://fiddle.sencha.com/#fiddle/481) demonstrating a simple working example.