| Package | feathers.core |
| Class | public class ToggleGroup |
| Inheritance | ToggleGroup EventDispatcher Object |
See also
| Property | Defined By | ||
|---|---|---|---|
| isSelectionRequired : Boolean
Determines if the user can deselect the currently selected item or
not. | ToggleGroup | ||
| selectedIndex : int
The index of the currently selected toggle. | ToggleGroup | ||
| selectedItem : IToggle
The currently selected toggle. | ToggleGroup | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor. | ToggleGroup | ||
![]() | addEventListener(type:String, listener:Function):void Registers an event listener at a certain object. | EventDispatcher | |
Adds a toggle to the group. | ToggleGroup | ||
![]() | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | |
![]() | dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void Dispatches an event with the given parameters to all objects that have registered
listeners for the given type. | EventDispatcher | |
![]() | hasEventListener(type:String):Boolean Returns if there are listeners registered for a certain event type. | EventDispatcher | |
Determines if the group includes the specified item. | ToggleGroup | ||
removeAllItems():void
Removes all toggles from the group. | ToggleGroup | ||
![]() | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | |
![]() | removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher | |
removeItem(item:IToggle):void
Removes a toggle from the group. | ToggleGroup | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the selection changes. | ToggleGroup | |||
| isSelectionRequired | property |
isSelectionRequired:Boolean
Determines if the user can deselect the currently selected item or
not. The selection may always be cleared programmatically by setting
the selected index to -1 or the selected item to
null.
If isSelectionRequired is set to true
and the toggle group has items that were added previously, and there
is no currently selected item, the item at index 0 will
be selected automatically.
public function get isSelectionRequired():Boolean public function set isSelectionRequired(value:Boolean):void| selectedIndex | property |
selectedIndex:intThe index of the currently selected toggle.
public function get selectedIndex():int public function set selectedIndex(value:int):void| selectedItem | property |
selectedItem:IToggleThe currently selected toggle.
public function get selectedItem():IToggle public function set selectedItem(value:IToggle):void| ToggleGroup | () | Constructor |
public function ToggleGroup()Constructor.
| addItem | () | method |
public function addItem(item:IToggle):void
Adds a toggle to the group. If it is the first item added to the
group, and isSelectionRequired is true, it
will be selected automatically.
Parameters
item:IToggle |
| hasItem | () | method |
public function hasItem(item:IToggle):BooleanDetermines if the group includes the specified item.
Parameters
item:IToggle |
Boolean |
| removeAllItems | () | method |
public function removeAllItems():voidRemoves all toggles from the group. No item will be selected.
| removeItem | () | method |
public function removeItem(item:IToggle):void
Removes a toggle from the group. If the item being removed is
selected and isSelectionRequired is true,
the final item will be selected. If isSelectionRequired
is false instead, no item will be selected.
Parameters
item:IToggle |
| change | Event |
starling.events.Eventstarling.events.Event.CHANGEDispatched when the selection changes.
An event type to be utilized in custom events. Not used by Starling right now.