PDA

View Full Version : TabItem caption text style



mwc_tonesoft
28 Aug 2008, 3:43 PM
Hi,

Say I have a TabPanel with 2 tabs, one called "General" and the other "Config". I want to change the font color of "Config" or "General" on-demand **AFTER** the tab is displayed. I tried many different methods of TabItem: setStyleText(), addStyleName(), etc. None of them work. I even tried setting the style before the tabs are render for the first time with no success.

There lacks general documentation (like the GWT developer's guide) for GXT that talks about the mechanism of CSS style among other things. All helps are appreciated.

Thank you

--Michael

Cputerace
26 Jan 2009, 7:15 AM
Were you ever able to get this to work? I also need to change the style of the tab in the tabbar.

Matt Kleweno
24 Jun 2009, 6:46 AM
If you set the style on the TabItem before it is rendered to something unique that you can search for later ("x-tab-strip-text-comment" in this example)


_tabItem.setTextStyle("x-tab-strip-text-comment");You can replace the Tab text style after the object is rendered to whatever you want (x-tab-strip-text-red) in this example.

NOTE: "x-tab-strip-text" is the default style of the tab item text.



if (....){
el().selectNode(".x-tab-strip-text-comment").replaceStyleName("x-tab-strip-text", "x-tab-strip-text-red");
} else {
// make the color of tab text normal
el().selectNode(".x-tab-strip-text-comment").replaceStyleName("x-tab-strip-text-red", "x-tab-strip-text");
}