View source
interface IIndexSelector
package feathers.core
extended by PageNavigator, TabNavigator, ComboBox, GridView, ListView, PageIndicator, PopUpListView, TabBar, ToggleGroup
Provides a selection from a range of integers.
Available since
1.0.0
.Variables
read onlymaxSelectedIndex:Int
The maximum index that may be selected. Returns -1
if no range is available.
Available since
1.0.0
.See also:
selectedIndex:Int
The currently selected index. Returns -1
if no index is selected.
When the value of the selectedIndex
property changes, the component
will dispatch an event of type Event.CHANGE
.
The following example selects a specific index:
control.selectedIndex = 2;
The following example clears the currently selected index:
control.selectedIndex = -1;
The following example listens for when the selection of a ListView
component changes, and it requests the new selected index:
var listView = new ListView();
function changeHandler(event:Event):Void
{
var listView = cast(event.currentTarget, ListView);
trace("selection change: " + listView.selectedIndex);
}
listView.addEventListener(Event.CHANGE, changeHandler);
Available since
1.0.0
.See also:
openfl.events.Event.CHANGE