PDA

View Full Version : Move tab locations dynamically in tab panel



wasima
4 Oct 2012, 10:16 AM
Hi ,
Suppose my tab panel has 3 tabs , tab1 , tab2 and tab3 in the order tab1,tab2,tab3. Is there any method/way how i can change order of these tabs programatically say to order tab1 tab3 tab2 and so on ?


Thanks in advance

skirtle
4 Oct 2012, 11:32 AM
Personally I'd have expected this to work but it doesn't seem to:


tabPanel.move(0, 1);

Instead I found I had to remove the child and re-add it:


tabPanel.remove(child, false);
tabPanel.add(child);

Be careful when grabbing references to the children that you don't accidentally grab hold of the tabbar.

wasima
4 Oct 2012, 9:56 PM
thanks Skirtle,
but when i remove a child , doesn't it mean deletion ? access to child will be lost i guess :-? thats y its not working for me when i try ur second solution

skirtle
5 Oct 2012, 2:25 AM
I don't know what you mean by deletion.

Passing false as the second argument to remove should ensure the component isn't destroyed, if that's what you mean.

What ExtJS version are you using? I tested my code against 4.1.0 and it worked fine there.