Packagefeathers.data
Classpublic class LocalAutoCompleteSource
InheritanceLocalAutoCompleteSource Inheritance starling.events.EventDispatcher
Implements IAutoCompleteSource

Product Version : Feathers 2.1.0

Creates a list of suggestions for an AutoComplete component by searching through items in a ListCollection.

See also

feathers.controls.AutoComplete
feathers.data.ListCollection


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
Constructor.
LocalAutoCompleteSource
  
load(textToMatch:String, result:IListCollection = null):void
Loads suggestions based on the text entered into an AutoComplete component.
LocalAutoCompleteSource
Events
 Event Summary Defined By
  Dispatched when the suggestions finish loading.LocalAutoCompleteSource
Property Detail
compareFunctionproperty
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


Implementation
    public function get compareFunction():Function
    public function set compareFunction(value:Function):void
dataProviderproperty 
dataProvider:IListCollection

A collection of items to be used as a source for auto-complete results.


Implementation
    public function get dataProvider():IListCollection
    public function set dataProvider(value:IListCollection):void
Constructor Detail
LocalAutoCompleteSource()Constructor
public function LocalAutoCompleteSource(source:IListCollection = null)

Constructor.

Parameters
source:IListCollection (default = null)
Method Detail
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)

Event Detail
complete Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.COMPLETE

Dispatched when the suggestions finish loading.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe 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.
dataA ListCollection containing the suggestions to display.
targetThe 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.