ui.ac.RichRemoteArrayMatcher Extends goog.ui.ac.RemoteArrayMatcher
An array matcher that requests rich matches via ajax and converts them into rich rows.

Inheritance

Constructor

goog.ui.ac.RichRemoteArrayMatcher(urlopt_noSimilar)

Parameters

url : string
The Uri which generates the auto complete matches. The search term is passed to the server as the 'token' query param.
opt_noSimilar : boolean=
If true, request that the server does not do similarity matches for the input token against the dictionary. The value is sent to the server as the 'use_similar' query param which is either "1" (opt_noSimilar==false) or "0" (opt_noSimilar==true).

Instance Methods

Public Protected Private
requestMatchingRows(tokenmaxMatchesmatchHandler)
Retrieve a set of matching rows from the server via ajax and convert them into rich rows.
Arguments:
token : string
The text that should be matched; passed to the server as the 'token' query param.
maxMatches : number
The maximum number of matches requested from the server; passed as the 'max_matches' query param. The server is responsible for limiting the number of matches that are returned.
matchHandler : Function
Callback to execute on the result after matching.
code »
setRowFilter(rowFilter)
Set the filter that is called before the array matches are returned.
Arguments:
rowFilter : Function
A function(rows) that returns an array of rows as a subset of the rows input array.
code »
buildUrl(uritokenmaxMatchesuseSimilaropt_fullString) ?string
Builds a complete GET-style URL, given the base URI and autocomplete related parameter values. Override this to build any customized lookup URLs.Can be used to change request method and any post content as well.
Arguments:
uri : string
The base URI of the request target.
token : string
Current token in autocomplete.
maxMatches : number
Maximum number of matches required.
useSimilar : boolean
A hint to the server.
opt_fullString : string=
Complete text in the input element.
Returns: ?string  The complete url. Return null if no request should be sent.
code »
disposeInternal()
No description.
code »
parseResponseText(responseText) Array.<string>
Parses and retrieves the array of suggestions from XHR response. Override this if the response is not a simple JSON array.
Arguments:
responseText : string
The XHR response text.
Returns: Array.<string>  The array of suggestions.
code »
requestMatchingRows(tokenmaxMatchesmatchHandleropt_fullString)
Retrieve a set of matching rows from the server via ajax.
Arguments:
token : string
The text that should be matched; passed to the server as the 'token' query param.
maxMatches : number
The maximum number of matches requested from the server; passed as the 'max_matches' query param. The server is responsible for limiting the number of matches that are returned.
matchHandler : Function
Callback to execute on the result after matching.
opt_fullString : string=
The full string from the input box.
code »
setContent(content)
Set the post data.
Arguments:
content : string
Post data.
code »
setHeaders(headers)
Set the HTTP headers.
Arguments:
headers : Object | goog.structs.Map
Map of headers to add to the request.
code »
setMethod(method)
Set the send method ("GET", "POST").
Arguments:
method : string
The send method; default: GET.
code »
setTimeoutInterval(interval)
Set the timeout interval.
Arguments:
interval : number
Number of milliseconds after which an incomplete request will be aborted; 0 means no timeout is set.
code »
shouldRequestMatches(uritokenmaxMatchesuseSimilaropt_fullString) boolean
Returns whether the suggestions should be updated? Override this to prevent updates eg - when token is empty.
Arguments:
uri : string
The base URI of the request target.
token : string
Current token in autocomplete.
maxMatches : number
Maximum number of matches required.
useSimilar : boolean
A hint to the server.
opt_fullString : string=
Complete text in the input element.
Returns: boolean  Whether new matches be requested.
code »
xhrCallback(tokenmatchHandlerevent)
Handles the XHR response.
Arguments:
token : string
The XHR autocomplete token.
matchHandler : Function
The AutoComplete match handler.
event : goog.events.Event
The XHR success event.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
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 »
disposeInternal()
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 »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
rowFilter_ :
A function(rows) that is called before the array matches are returned. It runs client-side and filters the results given by the server before being rendered by the client.
Code »
constructor :
No description.
Code »
content_ :
Data to submit during a POST.
Code »
headers_ :
Headers to send with every HTTP request.
Code »
lastListenerKey_ :
Key to the listener on XHR. Used to clear previous listeners.
Code »
method_ :
The HTTP send method (GET, POST) to use when making the ajax call.
Code »
url_ :
The base URL for the ajax call. The token and max_matches are added as query params.
Code »
useSimilar_ :
Whether similar matches should be found as well. This is sent as a hint to the server only.
Code »
The XhrIo object used for making remote requests. When a new request is made, the current one is aborted and the new one sent.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Properties

goog.ui.ac.RichRemoteArrayMatcher.superClass_ :
No description.
Code »

Package ui.ac

Package Reference