PDA

View Full Version : Set Focus on Tab Panel Item - Not working?



joefox
6 Oct 2010, 1:49 PM
I have a few items in my tab panel, one of which is called 'Group Exceptions' I cant seem to set focus on this panel.
I try to give the panel an ID also, but it throws an error when I do.

Here is my function to call focus:
//Set Focus On Selected Panel
var myTabPanelReference = Ext.ComponentMgr.get('group_exceptions_mm_tab');
myTabPanelReference.show();

Here is partical code:
layout:'anchor',
title: 'Group Exceptions',
id: 'group_exceptions_mm_tab',
iconCls:'group',
defaults:{style:'padding:5px'},
anchorSize: {width:800, height:600},
items:[{
...
...
...

StuartAshworth
7 Oct 2010, 1:06 AM
Use the setActiveTab method of the TabPanel

http://dev.sencha.com/deploy/dev/docs/source/TabPanel.html#method-Ext.TabPanel-setActiveTab

joefox
7 Oct 2010, 5:31 AM
My tab is already on the page, the code is for creating one, and setting on fly.

How do i target my main top panel, and say setfocus to tab 6?

troseberry
7 Oct 2010, 6:20 AM
check out the activate() method of the TabPanel