goog.Disposable | |
goog.events.EventTarget | goog.Disposable |
goog.ui.ac.AutoComplete | goog.events.EventTarget |
goog.ui.ac.Remote | goog.ui.ac.AutoComplete |
goog.ui.ac.RichRemote | goog.ui.ac.Remote |
url
: string
The Uri which generates the auto complete matches.
|
input
: Element
Input element or text area.
|
opt_multi
: boolean=
Whether to allow multiple entries; defaults
to false.
|
opt_useSimilar
: boolean=
Whether to use similar matches; e.g.
"gost" => "ghost".
|
Gets the attached InputHandler object.
Returns: goog.ui.ac.InputHandler
The input handler.
|
code » | ||
![]()
Set the post data for the matcher.
Arguments:
|
code » | ||
![]()
Set the HTTP headers for the matcher.
Arguments:
|
code » | ||
![]()
Set the send method ("GET", "POST") for the matcher.
Arguments:
|
code » | ||
![]()
Set the timeout interval for the matcher.
Arguments:
|
code » | ||
![]()
Set whether or not standard highlighting should be used when rendering rows.
Arguments:
|
code » |
![]()
Attaches the autocompleter to a text area or text input element
with an anchor element. The anchor element is the element the
autocomplete box will be positioned against.
|
code » | |||
![]()
Attach text areas or input boxes to the autocomplete by DOM reference. After
elements are attached to the autocomplete, when a user types they will see
the autocomplete drop down.
Arguments:
|
code » | |||
![]()
Cancel the active delayed dismiss if there is one.
|
code » | |||
![]()
Detach text areas or input boxes to the autocomplete by DOM reference.
Arguments:
|
code » | |||
![]()
Clears out the token, rows, and hilite, and calls
renderer.dismiss()
|
code » | |||
![]()
Call a dismiss after a delay, if there's already a dismiss active, ignore.
|
code » | |||
![]()
No description.
|
code » | |||
No description.
Returns: !Array
The current autocomplete suggestion items.
|
code » | |||
No description.
Returns: number
The id (not index!) of the currently highlighted row.
|
code » | |||
Gets the id corresponding to a particular index. (Does no checking.)
|
code » | |||
Gets the index corresponding to a particular id.
|
code » | |||
No description.
Returns: !Object
The data source providing the `autocomplete
suggestions.
|
code » | |||
No description.
Returns: goog.events.EventTarget
The renderer that
renders/shows/highlights/hides the autocomplete menu.
See constructor documentation for the expected renderer API.
|
code » | |||
Use this.getSuggestionCount().
No description.
Returns: number
Number of rows in the autocomplete.
|
code » | |||
No description.
Returns: !Object
The handler used to interact with the input DOM
element (textfield, textarea, or richedit), e.g. to update the
input DOM element with selected value.
|
code » | |||
No description.
|
code » | |||
No description.
Returns: number
The number of currently suggested items.
|
code » | |||
Gets the current target HTML node for displaying autocomplete UI.
Returns: Element
The current target HTML node for displaying autocomplete
UI.
|
code » | |||
No description.
Returns: ?string
The currently typed token used for completion.
|
code » | |||
![]()
Generic event handler that handles any events this object is listening to.
Arguments:
|
code » | |||
Returns whether or not the autocomplete is open and has a highlighted row.
Returns: boolean
Whether an autocomplete row is highlighted.
|
code » | |||
Hilites the id if it's valid and the row is not disabled, otherwise does
nothing.
|
code » | |||
Hilites the index, if it's valid and the row is not disabled, otherwise does
nothing.
|
code » | |||
Moves the hilite to the next non-disabled row.
Calls renderer.hiliteId() when there's something to do.
Returns: boolean
Returns true on a successful hilite.
|
code » | |||
Moves the hilite to the previous non-disabled row. Calls
renderer.hiliteId() when there's something to do.
Returns: boolean
Returns true on a successful hilite.
|
code » | |||
Cancels any delayed dismiss events immediately.
Returns: boolean
Whether a delayed dismiss was cancelled.
|
code » | |||
No description.
Returns: boolean
Whether the autocomplete's renderer is open.
|
code » | |||
![]()
Callback passed to Matcher when requesting matches for a token.
This might be called synchronously, or asynchronously, or both, for
any implementation of a Matcher.
If the Matcher calls this back, with the same token this AutoComplete
has set currently, then this will package the matching rows in object
of the form
{ id: an integer ID unique to this result set and AutoComplete instance, data: the raw row data from Matcher } |
code » | |||
![]()
Renders the rows and adds highlighting.
|
code » | |||
If there are any current matches, this passes the hilited row data to
selectionHandler.selectRow()
Returns: boolean
Whether there are any current matches.
|
code » | |||
![]()
Sets whether or not the up/down arrow can unhilite all rows.
Arguments:
|
code » | |||
![]()
Sets whether or not the first row should be highlighted by default.
Arguments:
|
code » | |||
![]()
Sets the current highlighted row to the given id (not index). Note
that this does not change any rendering.
NOTE(user): This method will likely go away when we figure
out a better API.
Arguments:
|
code » | |||
![]()
Sets the data source providing the autocomplete suggestions.
See constructor documentation for the interface.
Arguments:
|
code » | |||
![]()
Sets the max number of matches to fetch from the Matcher.
Arguments:
|
code » | |||
![]()
Sets the renderer that renders/shows/highlights/hides the autocomplete
menu.
See constructor documentation for the expected renderer API.
Arguments:
|
code » | |||
![]()
Sets the current target HTML node for displaying autocomplete UI.
Can be an implementation specific definition of how to display UI in relation
to the target node.
This target will be passed into
renderer.renderRows()
Arguments:
|
code » | |||
![]()
Sets the token to match against. This triggers calls to the Matcher to
fetch the matches (up to maxMatches), and then it triggers a call to
renderer.renderRows() .
Arguments:
|
code » | |||
![]()
Sets the current token (without changing the rendered autocompletion).
NOTE(user): This method will likely go away when we figure
out a better API.
Arguments:
|
code » | |||
![]()
Sets whether or not to request new suggestions immediately after completion
of a suggestion.
Arguments:
|
code » | |||
![]()
Sets whether or not selections can wrap around the edges.
Arguments:
|
code » | |||
![]()
Forces an update of the display.
Arguments:
|
code » |
![]()
Use
#listen instead, when possible. Otherwise, use
goog.events.listen if you are passing Object
(instead of Function) as handler.
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Arguments:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Removes listeners from this object. Classes that extend EventTarget may
need to override this method in order to remove references to DOM Elements
and additional listeners.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget
The parent EventTarget or null if
there is no parent.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Use
#unlisten instead, when possible. Otherwise, use
goog.events.unlisten if you are passing Object
(instead of Function) as handler.
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
No description.
|
Code » |
![]()
True iff the user can unhilight all rows by pressing the up arrow.
|
Code » | |
![]()
True iff the first row should automatically be highlighted
|
Code » | |
![]()
No description.
|
Code » | |
![]()
The timer id for dismissing autocomplete menu with a delay.
|
Code » | |
![]()
Id of the first row in autocomplete menu. Note that new ids are assigned
everytime new suggestions are fetched.
TODO(user): Figure out what subclass does with this value
and whether we should expose a more proper API.
|
Code » | |
![]()
Id of the currently highlighted row.
|
Code » | |
![]()
Mapping from text input element to the anchor element. If the
mapping does not exist, the input element will act as the anchor
element.
|
Code » | |
![]()
A data-source which provides autocomplete suggestions.
TODO(user): Tighten the type to !goog.ui.ac.AutoComplete.Matcher.
|
Code » | |
![]()
The maximum number of matches that should be returned
|
Code » | |
A renderer to render/show/highlight/hide the autocomplete menu.
|
Code » | |
![]()
Autocomplete suggestion items.
|
Code » | |
![]()
A handler which interacts with the input DOM element (textfield, textarea,
or richedit).
TODO(user): Tighten the type to !Object.
|
Code » | |
![]()
The target HTML node for displaying.
|
Code » | |
![]()
Currently typed token which will be used for completion.
|
Code » | |
![]()
Whether completion from suggestion triggers fetching new suggestion.
|
Code » | |
![]()
True iff item selection should wrap around from last to first. If
allowFreeSelect_ is on in conjunction, there is a step of free selection
before wrapping.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
Parent event target, used during event bubbling.
TODO(user): Change this to goog.events.Listenable. This
currently breaks people who expect getParentEventTarget to return
goog.events.EventTarget.
|
Code » |
![]()
No description.
|
Code » |