PDA

View Full Version : Why my TabPanel like this ?



robin2lyl
9 Jul 2012, 9:27 PM
TabPanel panel = new TabPanel();
panel.setBorders(false);
TabItem item1 = new TabItem("Hello World 1");
item1.addText("Hello...");
item1.addStyleName("pad-text");
TabItem item2 = new TabItem("Hello World 2");
item2.addText("... World!");
item2.addStyleName("pad-text");
panel.add(item1);
panel.add(item2);
The page like this:
3699036991
Why there has a line in the active TabPanel?

but when i add panel.setPlain(true);
the effect like this:
37123

Why?

Martin Hobby Vavrous
8 Sep 2012, 7:22 AM
as mentioned --- I got four panels A, B, C and D ... Don't know why, but in front (on init) is panel B ... can someone help?

Martin Hobby Vavrous
8 Sep 2012, 8:39 AM
Just try to give an ID to your TabPanel - in my example named "MyTabPanel", given ID "MyTabPanel"...

got one window 4 panels in it, window without ID, tabpanel with ID "MyTabPanel"

write to console

Ext.getCmp('MyTabPanel').setActiveTab(0); //for first tab
Ext.getCmp('MyTabPanel').setActiveTab(2); //for third tab etc.

OR

if you want to do it by default (i.e. whenever you open your project preview) just put into tabpanel options (in Designer - lower right side by default) "activeTab" to 0 (or any other number) ... more info is here
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tab.Panel-cfg-activeTab

robin2lyl
18 Sep 2012, 1:10 AM
Thanks!
but TabPanel has setSelection,not setActiveTab.