ch.AutoComplete (Class)

Documentation updated on Fri Mar 09 2012 15:11:01 GMT-0300 (GMT-03:00), generated by JsDoc Toolkit 2.4.0

Overview

AutoComplete is a UI-Component.

Summary

Visibility Name Description
<protected>  
Inner reference to content container.
<protected>  
The input where the AutoComplete works.
<protected>  
It gives the main behavior(focus, blur and turn off autocomplete attribute) to the $trigger.
<protected>  
It does the query to the server if configured an URL, or it does the query inside the array given.
<public>  
The element reference.
<protected>  
Reference to the Float component instanced.
<protected>  
Internal hide method.
<protected>  
It has the items loaded.
<protected>  
The number of the selected item.
<private>  
Select an item.
<protected>  
Internal show method.
<protected>  
List of the shown suggestions.
<protected>  
Binds the behavior related to the list.
<private>  
Reference to a internal component instance, saves all the information and configuration properties.
<public>  
The component's type.
<public>  
uid
The component's instance unique identifier.

Fields borrowed from class ch.Controls: createFloat

Fields borrowed from class ch.Uiobject: DOMParent,originalContent,position,staticContent

Visibility Name Description
<public>  
Add suggestions to be shown.

Methods borrowed from class ch.Uiobject: content, prevent

Methods borrowed from class ch.Object: callbacks, off, on, once, trigger

Visibility Name Description
<public>  
Triggers when the component is ready to use (Since 0.8.0).

Classdetail

Parameters

  • conf: Object, Optional. Object with configuration properties.
  • conf.url: String, Optional. The url pointing to the suggestions's service.
  • conf.message: String, Optional. It represent the text when no options are shown.
  • conf.suggestions: Array, Optional. The list of suggestions. Use it when you don't have server side suggestions service. Don't use conf.url with this option.

Returns

  • itself

Examples

// Create a new autoComplete with configuration.
var me = $(".example").autoComplete({
    "url": "http://site.com/mySuggestions?q=",
    "message": "Write..."
});

Properties detail

$content (protected, jQuery)

Inner reference to content container. Here is where the content will be added.

$trigger (protected, jQuery)

The input where the AutoComplete works.

configBehavior (protected, Function)

It gives the main behavior(focus, blur and turn off autocomplete attribute) to the $trigger.

doQuery (protected, Function)

It does the query to the server if configured an URL, or it does the query inside the array given.

element (public, HTMLElement)

The element reference.

float (protected, Object)

Reference to the Float component instanced.

hide (protected, Function)

Internal hide method. It removes the behavior.

populateContent (protected, Boolean)

It has the items loaded.

selected (protected, Number)

The number of the selected item.

selectItem (private, Function)

Select an item.

show (protected, Function)

Internal show method. It adds the behavior.

suggestions (protected, Array)

List of the shown suggestions.

suggestionsBehavior (protected, Function)

Binds the behavior related to the list.

that (private, object)

Reference to a internal component instance, saves all the information and configuration properties.

type (public, string)

The component's type.

uid (public, number)

The component's instance unique identifier.

Methods detail

suggest (public)

Add suggestions to be shown.

Returns
  • itself

Events detail

ready (public)

Triggers when the component is ready to use (Since 0.8.0).

Examples
// Following the first example, using 'me' as autoComplete's instance controller:
me.on("ready",function () {
	this.show();
});