| Package | feathers.data |
| Class | public class LocalAutoCompleteSource |
| Inheritance | LocalAutoCompleteSource starling.events.EventDispatcher |
| Implements | IAutoCompleteSource |
| Product Version : | Feathers 2.1.0 |
AutoComplete component
by searching through items in a ListCollection.
See also
| Property | Defined By | ||
|---|---|---|---|
| compareFunction : Function
A function used to compare items from the data provider with the
string passed to the load() function in order to
generate a list of suggestions. | LocalAutoCompleteSource | ||
| dataProvider : IListCollection
A collection of items to be used as a source for auto-complete
results. | LocalAutoCompleteSource | ||
| Method | Defined By | ||
|---|---|---|---|
LocalAutoCompleteSource(source:IListCollection = null)
Constructor. | LocalAutoCompleteSource | ||
load(textToMatch:String, result:IListCollection = null):void
Loads suggestions based on the text entered into an
AutoComplete component. | LocalAutoCompleteSource | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the suggestions finish loading. | LocalAutoCompleteSource | |||
| compareFunction | property |
compareFunction:Function
A function used to compare items from the data provider with the
string passed to the load() function in order to
generate a list of suggestions. The function should return
true if the item should be included in the list of
suggestions.
The function is expected to have the following signature:
function( item:Object, textToMatch:String ):Boolean
public function get compareFunction():Function public function set compareFunction(value:Function):void| dataProvider | property |
dataProvider:IListCollectionA collection of items to be used as a source for auto-complete results.
public function get dataProvider():IListCollection public function set dataProvider(value:IListCollection):void| LocalAutoCompleteSource | () | Constructor |
public function LocalAutoCompleteSource(source:IListCollection = null)Constructor.
Parameterssource:IListCollection (default = null) |
| load | () | method |
public function load(textToMatch:String, result:IListCollection = null):void
Loads suggestions based on the text entered into an
AutoComplete component.
If an existing ListCollection is passed in as the
result, all items will be removed before new items are added.
Parameters
textToMatch:String | |
result:IListCollection (default = null) |
| complete | Event |
starling.events.Eventstarling.events.Event.COMPLETEDispatched when the suggestions finish loading.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
data | A ListCollection containing
the suggestions to display. |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |