Packagefeathers.data
Classpublic class LocalAutoCompleteSource
InheritanceLocalAutoCompleteSource Inheritance EventDispatcher Inheritance Object
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
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
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
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
  
load(textToMatch:String, result:IListCollection = null):void
Loads suggestions based on the text entered into an AutoComplete component.
LocalAutoCompleteSource
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
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.

Event type that may be used whenever something finishes.