Jx.ButtonSet

Extends: Object

Implements: Options, Events

A ButtonSet manages a set of Jx.Button instances by ensuring that only one of the buttons is active.  All the buttons need to have been created with the toggle option set to true for this to work.

Example

var toolbar = new Jx.Toolbar('bar');
var buttonSet = new Jx.ButtonSet();

var tab1 = new Jx.Button({label: 'b1', toggle:true, contentID: 'content1'});
var tab2 = new Jx.Button({label: 'b2', toggle:true, contentID: 'content2'});
var tab3 = new Jx.Button({label: 'b3', toggle:true, contentID: 'content3'});
var tab4 = new Jx.Button({label: 'b4', toggle:true, contentURL: 'test_content.html'});

buttonSet.add(b1,b2,b3,b4);

Events

changethe current button has changed

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Jx.ButtonSetExtends: Object
Properties
buttons{Array} array of buttons that are managed by this button set
Constructor
Jx.ButtonSetCreate a new instance of Jx.ButtonSet
Functions
addAdd one or more Jx.Buttons to the ButtonSet.
removeRemove a button from this Button.
setActiveButtonSet the active button to the one passed to this method
selectionChangedHandle selection changing on the buttons themselves and activate the appropriate button in response.

Properties

buttons

{Array} array of buttons that are managed by this button set

Constructor

Jx.ButtonSet

Create a new instance of Jx.ButtonSet

Parameters

optionsan options object, only event handlers are supported as options at this time.

Functions

add

add : function()

Add one or more Jx.Buttons to the ButtonSet.

Parameters

button{Jx.Button} an instance of Jx.Button to add to the button set.  More than one button can be added by passing extra parameters to this method.

remove

remove : function(button)

Remove a button from this Button.

Parameters

button{Jx.Button} the button to remove.

setActiveButton

setActiveButton: function(button)

Set the active button to the one passed to this method

Parameters

button{Jx.Button} the button to make active.

selectionChanged

Handle selection changing on the buttons themselves and activate the appropriate button in response.

Parameters

button{Jx.Button} the button to make active.
Create a new instance of Jx.ButtonSet
add : function()
Add one or more Jx.Buttons to the ButtonSet.
Extends: Object
remove : function(button)
Remove a button from this Button.
setActiveButton: function(button)
Set the active button to the one passed to this method