PDA

View Full Version : Adding items to a Sencha Tab panel dynamically



heyjii
1 Sep 2011, 3:00 AM
How can I add items to a Sencha Tab Panel in runtime. I used add() function but it is not working?
Thanks

Arun A G

niteblade
2 Sep 2011, 7:36 PM
Calling setActiveItem() should do the trick. If you want to do the add() make sure you call doLayout() after or it won't render.

Bob

atula_a1
4 Sep 2011, 8:30 PM
You can:
mypanel.add(mycomponent1);
mypanel.add(mycomponent2);
mypanel.add(mycomponent3);

mypanel.doLayout(); // important


Notes: mypanel must has its layout.

heyjii
4 Sep 2011, 8:42 PM
Thanks atula_a1 it works for me even without doLayout() function. My I have used the add() method in wrong format...ie
mypanel.items.add();
that was wrong and when I cleared items it works fine.