• jqxButtons API
  • jqxSwitchButton API
  • jqxDropDownButton API
  • jqxButtonGroup API

Properties

Name Type Default
delay Number 50

Specifies the interval between two Click events. This property is available only in the jqxRepeatButton. The jqxRepeatButton raises Click events repeatedly when the button is pressed.

Code examples

Set the delay property.

$("#jqxButton").jqxRepeatButton({ delay: 25});

Get the delay property.

var delayed = $('#jqxButton').jqxRepeatButton('delay');
disabled Boolean false

Enables or disables the button.

Code examples

Set the disabled property.

$('#jqxButton').jqxButton({disabled: false });

Get the disable property.

var disabled = $('#jqxButton').jqxButton('disabled');
height Number/String null

Sets or gets the button's height.

Code examples

Set the height property.

$('#jqxButton').jqxButton({ height: '25px' }); 

Get the height property.

var height = $('#jqxButton').jqxButton('height');
imgSrc String ""

Sets or gets the button's image source.

Code examples

Set the imgSrc property.

$('#jqxButton').jqxButton({ imgSrc: '../../images/andrew.png' }); 

Get the imgSrc property.

var imgSrc = $('#jqxButton').jqxButton('imgSrc');
imgWidth Number 16

Sets or gets the button's image width.

Code examples

Set the imgWidth property.

$('#jqxButton').jqxButton({imgWidth: 16, imgSrc: '../../images/andrew.png' }); 

Get the imgWidth property.

var imgWidth = $('#jqxButton').jqxButton('imgWidth');
imgHeight Number 16

Sets or gets the button's image height.

Code examples

Set the imgHeight property.

$('#jqxButton').jqxButton({imgHeight: 16, imgSrc: '../../images/andrew.png' }); 

Get the imgHeight property.

var imgHeight = $('#jqxButton').jqxButton('imgHeight');
imgPosition String "center"

Sets or gets the button's image position. Possible values: "left", "top", "center", "bottom", "right", "topLeft", "bottomLeft", "topRight", "bottomRight".

Code examples

Set the imgPosition property.

$('#jqxButton').jqxButton({imgPosition: "left", imgSrc: '../../images/andrew.png' }); 

Get the imgPosition property.

var imgPosition = $('#jqxButton').jqxButton('imgPosition');
roundedCorners String 'jqx-rc-all'

Enables or disables the rounded corners functionality. This property setting has effect in browsers which support CSS border-radius.

Possible Values:
'all' - for all corners
'top'- for top corners
'bottom' - for bottom corners
'left' - for left corners
'right' - for right corners
'top-right' - for top right corners
'top-left' - for top left corners
'bottom-right' - for bottom right corners
'bottom-left' - for bottom left corners

Code examples

Set the roundedCorners property.

$("#jqxButton").jqxButton({ roundedCorners: 'jqx-rc-t'});

Get the roundedCorners property.

var roundedCourners = $('#jqxButton').jqxButton('roundedCorners');
rtl Boolean false

Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.

Code example

Set the rtl property.

$('#jqxButton').jqxButton({rtl : true}); 

Get the rtl property.

var rtl = $('#jqxButton').jqxButton('rtl'); 
textPosition String ""

Sets or gets the button's text position. Possible values: "left", "top", "center", "bottom", "right", "topLeft", "bottomLeft", "topRight", "bottomRight".

Code examples

Set the textPosition property.

$('#jqxButton').jqxButton({textPosition: "left"}); 

Get the textPosition property.

var textPosition = $('#jqxButton').jqxButton('textPosition');
textImageRelation String "overlay"

Sets or gets the button's text image relation. Possible values: "imageBeforeText", "imageAboveText", "textAboveImage", "textBeforeImage" and "overlay".

Code examples

Set the imageBeforeText property.

$('#jqxButton').jqxButton({textImageRelation: "imageBeforeText"}); 

Get the imageBeforeText property.

var imageBeforeText = $('#jqxButton').jqxButton('imageBeforeText');
theme String ''

Sets the widget's theme.

jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file. In order to set a theme, you need to do the following:
  • Include the theme's CSS file after jqx.base.css.
    The following code example adds the 'energyblue' theme.
    
    
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.energyblue.css" type="text/css" />
    
  • Set the widget's theme property to 'energyblue' when you initialize it.
template String 'default'

Determines the button's template as an alternative of the default styles.

Possible Values:
'default' - the default button's template. The button's style depends only on its "theme" property value.
'primary' - dark blue button for extra visual weight.
'success' - green button for successful or positive action.
'warning' - orange button which indicates caution.
'danger' - red button which indicates a dangerous or negative action.
'inverse' - dark gray button, not tied to a semantic action or use.
'info' - blue button, not tied to a semantic action or use.
'link' - making it look like a link .

Code examples

Set the template property.

$("#jqxButton").jqxButton({ template: 'primary'});

Get the template property.

var template = $('#jqxButton').jqxButton('template');
toggled Boolean false

Sets or gets the button's toggle state. ( available in jqxToggleButton ).

Code examples

Set the toggled property.

$('#jqxButton').jqxToggleButton({ toggled: true }); 

Get the toggled property.

var toggled = $('#jqxButton').jqxToggleButton('toggled');
width Number/String null

Sets ot gets the button's width.

Code examples

Set the width property.

$('#jqxButton').jqxButton({ width: '250px'}); 

Get the width property.

var width = $('#jqxButton').jqxButton('width');
value String ""

Sets or gets the button's value.

Code examples

Set the value property.

$('#jqxButton').jqxButton({value: "Button"}); 

Get the textPosition property.

var value = $('#jqxButton').jqxButton('value');

Events

click Event

This event is triggered when the button is clicked.

Code examples

Bind to the click event by type: jqxButton.

$('#jqxButton').on('click', function () { // Some code here. }); 

Methods

check Method

Checks the button. ( available in jqxToggleButton ).

Parameter Type Description
None
Return Value
None

Code examples

Invoke the check method.

$('#jqxButton').jqxToggleButton('check'); 
destroy Method

Destroys the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the destroy method.

$('#jqxButton').jqxButton('destroy'); 
focus Method

Focuses the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the focus method.

$('#jqxButton').jqxButton('focus'); 
render Method

Renders the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the render method.

$('#jqxButton').jqxButton('render'); 
toggle Method

Toggles the button's checked state. ( available in jqxToggleButton ).

Parameter Type Description
None
Return Value
None

Code examples

Invoke the toggle method.

$('#jqxButton').jqxToggleButton('toggle'); 
unCheck Method

Unchecks the button. ( available in jqxToggleButton ).

Parameter Type Description
None
Return Value
None

Code examples

Invoke the unCheck method.

$('#jqxButton').jqxToggleButton('unCheck'); 
val Method

Sets or gets the value.

Parameter Type Description
value(optional) String
Return Value
String

Code example

Invoke the val method.

// Get the value.
var value = $("#jqxButton").jqxButton('val');
// Get the value using jQuery's val()
var value = $("#jqxButton").val();
// Set value.
$("#jqxButton").jqxButton('val', "New Value");
// Set value using jQuery's val().
$("#jqxButton").val("New Value");

Properties

Name Type Default
checked Boolean false

Sets or gets the check state.

Code examples

Set the checked property.

$('#jqxSwitchButton').jqxSwitchButton({ checked:true }); 

Get the checked property.

var checked = $('#jqxSwitchButton').jqxSwitchButton('checked');
disabled Boolean false

Sets or gets whether the switch button is disabled.

Code examples

Set the disabled property.

$('#jqxSwitchButton').jqxSwitchButton({ disabled:true }); 

Get the disabled property.

var disabled = $('#jqxSwitchButton').jqxSwitchButton('disabled');
height Number/String null

Sets or gets the height.

Code examples

Set the height property .

$('#jqxSwitchButton').jqxSwitchButton({height:"400px"});

Get the height property.

var height = $('#jqxSwitchButton').jqxSwitchButton('height');
orientation String 'horizontal'

Determines the jqxSwitchButton's orientation.

Possible Values:
'horizontal' 
'vertical'

Code examples

Set the orientation property.

$('#jqxSwitchButton').jqxSwitchButton({ orientation:vertical }); 

Get the orientation property.

var orientation = $('#jqxSwitchButton').jqxSwitchButton('orientation');
onLabel String 'On'

Sets or gets the string displayed when the button is checked.

Code examples

Set the onLabel property.

$('#jqxSwitchButton').jqxSwitchButton({ onLabel:'ON' }); 

Get the onLabel property.

var onLabel = $('#jqxSwitchButton').jqxSwitchButton('onLabel');
offLabel String 'Off'

Sets or gets the string displayed when the button is unchecked.

Code examples

Set the offLabel property.

$('#jqxSwitchButton').jqxSwitchButton({ offLabel:'OFF' }); 

Get the offLabel property.

var offLabel = $('#jqxSwitchButton').jqxSwitchButton('offLabel');
thumbSize String '40%'

Sets or gets the size of the thumb in percentages.

Code examples

Set the thumbSize property.

$('#jqxSwitchButton').jqxSwitchButton({ thumbSize:'50%' }); 

Get the thumbSize property.

var thumbSize = $('#jqxSwitchButton').jqxSwitchButton('thumbSize');
width Number/String null

Sets or gets the width.

Code examples

Set the width property.

$('#jqxSwitchButton').jqxSwitchButton({width:"200px"});

Get the width property.

var width = $('#jqxSwitchButton').jqxSwitchButton('width');

Events

checked Event

This event is triggered when the switch button is checked.

Code examples

Bind to the checked event by type: jqxSwitchButton.

$('#jqxSwitchButton').on('checked', function (event) { // Some code here.}); 
change Event

This event is triggered when the switch button's state changes from one state to another.

Code examples

Bind to the change event by type: jqxSwitchButton.

$('#jqxSwitchButton').on('change', function (event) { // Some code here.}); 
unchecked Event

This event is triggered when the switch button is unchecked.

Code examples

Bind to the unchecked event by type: jqxSwitchButton.

$('#jqxSwitchButton').on('unchecked', function (event) { // Some code here.}); 

Methods

check Method

Checks the button.

Parameter Type Description
None
Return Value
None

Code example

Invoke the check method.

$('#jqxSwitchButton').jqxSwitchButton('check');
disable Method

Disables the switch button.

Parameter Type Description
None
Return Value
None

Code example

Invoke the disable method.

$('#jqxSwitchButton').jqxSwitchButton('disable');
enable Method

Enables the switch button.

Parameter Type Description
None
Return Value
None

Code example

Invoke the enable method.

$('#jqxSwitchButton').jqxSwitchButton('enable');
toggle Method

Toggles the check state. This method is automatically called when the user clicks the switch button.

Parameter Type Description
None
Return Value
None

Code example

Invoke the toggle method.

$('#jqxSwitchButton').jqxSwitchButton('toggle');
uncheck Method

Unchecks the button.

Parameter Type Description
None
Return Value
None

Code example

Invoke the uncheck method.

$('#jqxSwitchButton').jqxSwitchButton('uncheck');
val Method

Sets or gets the value.

Parameter Type Description
value(optional) Boolean
Return Value
Boolean

Code example

Invoke the val method.

// Get the value.
var value = $("#jqxSwitchButton").jqxSwitchButton('val');
// Get the value using jQuery's val()
var value = $("#jqxSwitchButton").val();
// Set value.
$("#jqxSwitchButton").jqxSwitchButton('val', true);
// Set value using jQuery's val().
$("#jqxSwitchButton").val(true);

Properties

Name Type Default
disabled Boolean false

Enables or disables the jqxButtonGroup.

Code examples

Set the disabled property.

$('#jqxButtonGroup').jqxButtonGroup({disabled: false });

Get the disabled property.

var disabled = $('#jqxButtonGroup').jqxButtonGroup('disabled');
enableHover Boolean false

Enables or disabled the highlight state.

Code examples

Set the enableHover property.

$('#jqxButtonGroup').jqxButtonGroup({enableHover: true });

Get the enableHover property.

var enableHover = $('#jqxButtonGroup').jqxButtonGroup('enableHover');
mode String 'default'

Sets or gets the jqxButtonGroup's mode.

Possible Values:
'checkbox'
'radio'
'default'

Code examples

Set the mode property.

$('#jqxButtonGroup').jqxButtonGroup({mode: 'radio' });

Get the mode property.

var mode = $('#jqxButtonGroup').jqxButtonGroup('mode');
rtl Boolean false

Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.

Code example

Set the rtl property.

$('#jqxButtonGroup').jqxButtonGroup({rtl : true}); 

Get the rtl property.

var rtl = $('#jqxButtonGroup').jqxButtonGroup('rtl'); 
template String 'default'

Determines the template as an alternative of the default styles.

Possible Values:
'default' - the default template. The style depends only on the "theme" property value.
'primary' - dark blue style for extra visual weight.
'success' - green style for successful or positive action.
'warning' - orange style which indicates caution.
'danger' - red style which indicates a dangerous or negative action.
'info' - blue button, not tied to a semantic action or use.

Code examples

Set the template property.

$("#jqxButtonGroup").jqxButtonGroup({ template: 'primary'});

Get the template property.

var template = $('#jqxButtonGroup').jqxButtonGroup('template');
theme String ''

Sets the widget's theme.

jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file. In order to set a theme, you need to do the following:
  • Include the theme's CSS file after jqx.base.css.
    The following code example adds the 'energyblue' theme.
    
    
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.energyblue.css" type="text/css" />
    
  • Set the widget's theme property to 'energyblue' when you initialize it.

Events

buttonclick Event

This event is triggered when a button is clicked.

Code examples

Bind to the buttonclick event by type: jqxButtonGroup.

$('#jqxButtonGroup').on('buttonclick', function () { // Some code here. }); 
selected Event

This event is triggered when a button is selected - in checkboxes or radio buttons mode.

Code examples

Bind to the selected event by type: jqxButtonGroup.

$('#jqxButtonGroup').on('selected', function () { // Some code here. }); 
unselected Event

This event is triggered when a button is unselected - in checkbox or radio buttons mode.

Code examples

Bind to the unselected event by type: jqxButtonGroup.

$('#jqxButtonGroup').on('unselected', function () { // Some code here. }); 

Methods

disableAt Method

Disables a button at specific index.

Parameter Type Description
index Number
Return Value
None

Code examples

Invoke the disableAt method.

$('#jqxButtonGroup').jqxButtonGroup('disableAt', 0); 
disable Method

Disables jqxButtonGroup.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the disable method.

$('#jqxButtonGroup').jqxButtonGroup('disable'); 
destroy Method

Destroys the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the destroy method.

$('#jqxButtonGroup').jqxButtonGroup('destroy'); 
enable Method

Enables the jqxButtonGroup.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the enable method.

$('#jqxButtonGroup').jqxButtonGroup('enable'); 
enableAt Method

Enables a button at specific index.

Parameter Type Description
index Number
Return Value
None

Code examples

Invoke the enableAt method.

$('#jqxButtonGroup').jqxButtonGroup('enableAt', 0); 
focus Method

Focuses the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the focus method.

$('#jqxButtonGroup').jqxButtonGroup('focus'); 
getSelection Method

Gets the index or indexes of the selected button(s).

  • Returns undefined when the "mode" property is "default".
  • Returns the index of the selected button when the "mode" property is set the "radio". For example, if the first button is selected, the retuned value is 0.
  • Returns an array of the selected buttons when the "mode" property is set to "checkbox". For example, if you have a group of three buttons and the first and third buttons are selected, the returned value will be [0, 2]

Parameter Type Description
None
Return Value
Number/Array

Code examples

Invoke the getSelection method.

var jqxButtonGroup = $('#jqxButtonGroup').jqxButtonGroup('getSelection'); 
render Method

Renders the widget.

Parameter Type Description
None
Return Value
None

Code examples

Invoke the render method.

$('#jqxButtonGroup').jqxButtonGroup('render'); 
setSelection Method

Selects a button in checkbox or radio buttons mode

Parameter Type Description
index Number
Return Value
None

Code examples

Invoke the setSelection method. The index is zero-based. For selecting the first button, call the method with 0.

$('#jqxButtonGroup').jqxButtonGroup('setSelection', 0);

AltStyle によって変換されたページ (->オリジナル) /