top

SFBUTTON

** This class will not be supported in 2015.

   All functionalities of sfButton class are more improved, integrating with CAPH. Therefore sfButton class is not supported since 2015 Smart TV. To use functions of sfButton class, refer to here.


This is the class for Button UI.

Add the following line for sfButton class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js">/script>

You can declare sfButton class like this :

  ex) $('#div ID').sfButton({ Json type });


Methods

blur

Description
The blur function - Removes the focus state from component and adds the blur state. Removes the CSS class provided in widgetFocusCssClass and adds the class provided in widgetBlurCssClass.
Parameters
none
Return■Object
  - jQuery
Emulator SupportN
SDK ConstraintNone
Example
//This example blurs the focus on a particular button.
 
$('#buttons').sfButton({
    text : [ "Button 1", "Button 2", "Button 3" ]
});
$('#button1').sfButton('blur');

focus

Description
The focus function sets focus on the specified button as follows: - Adds ‘focus’ CSS class to the selected button. - Removes the CSS class provided in the widgetBlurCssClass and adds the CSS class provided in the widgetFocusCssClass. - Removes ‘focus’ CSS class from any focused button and sets the focus on the selected button. - Sets ‘focus’ CSS class on elements containing rounded corners if the focused button is the side button in a whole button set.
Parameters
■index 
  - Number
  - index of item to be focused
  - [default:0]
Return■Object
  - jQuery
Emulator SupportN
SDK ConstraintNone
Example
//This example sets focus on a particular button.
 
$('#buttons').sfButton({
    text : [ "Button 1", "Button 2", "Button 3" ]
});
$('#button1').sfButton('focus');

getIndex

Description
This function returns current index. If the text option is multiple, this index can be more than 0.
Parameters
none
Return■Object
  - jQuery
Emulator SupportN
SDK ConstraintNone
Example
$('#buttons').sfButton({
    text : [ "Button 1", "Button 2", "Button 3" ]
});
$('#button1').sfButton('focus', 2);
alert($('#button1').sfButton('getIndex'));  // prints 2