Newer Version Available
setTabTextStyle()
Sets a cascading style sheet (CSS) on a specified
tab’s text. If a tab is not specified, the CSS is set on the enclosing
tab’s text. Use this method to customize a tab’s text style. This method is only available in API version 28.0 or
later.
Syntax
1sforce.console. setTabTextStyle(style:String, tabID:String, (optional)callback:Function))Arguments
Sample Code–Visualforce
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<apex:page>
18 <A HREF="#" onClick="testSetTabTextStyle();return false">
19 Click here to change the enclosing tab’s text style</A> <BR/>
20 <A HREF="#" onClick="testResetTabTextStyle(); return false;">
21 Click here to reset the enclosing tab’s text style</A>
22
23 <apex:includeScript value="/support/console/28.0/integration.js"/>
24 <script type="text/javascript">
25 function checkResult(result) {
26 if (result.success) {
27 alert('Tab text style set successfully!');
28 } else {
29 alert('Tab text style cannot be set!');
30 }
31 }
32 function testSetTabTextStyle() {
33 sforce.console.setTabTextStyle('color:blue;font-style:italic;', null, checkResult);
34 }
35 function testResetTabTextStyle() {
36 sforce.console.setTabTextStyle(null, null, checkResult);
37 }
38 </script>
39</apex:page>Response
This method is asynchronous, so it returns its response in an object in a callback method. The response object contains the following field:
| Name | Type | Description |
|---|---|---|
| success | boolean | true if setting the tab’s text style was successful, false if setting the tab’s text style wasn’t successful. |