goog.ui.ac.Renderer
Classgoog.ui.ac.Renderer
> goog.events.EventTarget
> goog.Disposable
goog.ui.ac.Renderer(opt_parentNode, opt_customRenderer, opt_rightAlign,
opt_useStandardHighlighting)
Class for rendering the results of an auto-complete in a drop down list.
opt_parentNode
{Element
=}
opt_customRenderer
{?({renderRow
}|{render
})=}
opt_rightAlign
{boolean
=}
opt_useStandardHighlighting
{boolean
=}
goog.ui.ac.Renderer.CustomRenderer
ClassClass allowing different implementations to custom render the autocomplete. Extending classes should override the render function. … more
.DELAY_BEFORE_MOUSEOVER
{number
}The delay before mouseover events are registered, in milliseconds
.activeClassName
{string
}Class name for active row div. Active row will have rowClassName & activeClassName & legacyActiveClassName.
.addEventListener(type, handler, opt_capture, opt_handlerScope)
Inherited from goog.events.EventTarget
.
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. Supported for legacy but use goog.events.listen(src, type, handler) instead.
type
{string
}
handler
{Function
|Object
}
opt_capture
{boolean
=}
opt_handlerScope
{Object
=}
.addOnDisposeCallback(callback, opt_scope)
Inherited from goog.Disposable
.
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
callback
{!Function
}
opt_scope
{Object
=}
.animation_
{goog.fx.Animation
|undefined
}Animation in progress, if any.
.className
{string
}Classname for the main element
.creationStack
{string
}Inherited from goog.Disposable
.
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
.dismiss()
Hide the object.
.dispatchEvent(e)
Inherited from goog.events.EventTarget
.
Dispatches an event (or event like object) and calls all listeners listening for events of this type. The type of the event is decided by the type property on the event object. If any of the listeners returns false OR calls preventDefault then this function will return false. If one of the capture listeners calls stopPropagation, then the bubble listeners won't fire.
e
{string
|Object
|goog.events.Event
}
boolean
}
.dispose()
Inherited from goog.Disposable
.
Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
void
}
.disposeInternal()
[protected]Disposes of the renderer and its associated HTML.
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.getElement()
Gets the renderer's element.
Element
}
.getParentEventTarget()
Inherited from goog.events.EventTarget
.
Returns the parent of this event target to use for bubbling.
goog.events.EventTarget
}
.highlightedClassName
{string
}Class name for the bold tag highlighting the matched part of the text.
.hiliteId(id)
Sets the 'active' class of the item with a given id.
id
{number
}
.hiliteNone()
Removes the 'active' class from the currently selected row.
.hiliteRow(index)
Sets the 'active' class of the nth item.
index
{number
}
.hilitedRow_
[protected] {number
}The index of the currently highlighted row
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.isVisible()
boolean
}
.redraw()
Redraw (or draw if this is the first call) the rendered auto-complete drop down.
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.removeEventListener(type, handler, opt_capture, opt_handlerScope)
Inherited from goog.events.EventTarget
.
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.
type
{string
}
handler
{Function
|Object
}
opt_capture
{boolean
=}
opt_handlerScope
{Object
=}
.renderRowHtml(row, token)
Render a row by creating a div and then calling row rendering callback or default row handler
row
{Object
}
token
{string
}
Element
}
.renderRows(rows, token, opt_target)
Render the autocomplete UI
rows
{Array
}
token
{string
}
opt_target
{Element
=}
.reposition()
Repositions the auto complete popup relative to the location node, if it exists and the auto position has been set.
.rowClassName
{string
}Classname for row divs
.rowDivs_
[protected] {Array
.<Element
>}Array of the node divs that hold each result that is being displayed.
.setAnchorElement(anchor)
Sets the anchor element for the subsequent call to renderRows.
anchor
{Element
}
.setAutoPosition(auto)
Sets whether the renderer should try to determine where to position the drop down.
auto
{boolean
}
.setHighlightAllTokens(highlightAllTokens)
Set whether or not to highlight all matching tokens rather than just the first.
highlightAllTokens
{boolean
}
.setMenuFadeDuration(duration)
Sets the duration (in msec) of the fade animation when menu is shown/hidden. Setting to 0 (default) disables animation entirely.
duration
{number
}
.setParentEventTarget(parent)
Inherited from goog.events.EventTarget
.
Sets the parent of this event target to use for bubbling.
parent
{goog.events.EventTarget
?}
.setRightAlign(align)
Set whether to align autocomplete to the right of the target element.
align
{boolean
}
.setTopAlign(align)
Set whether to align autocomplete to top of target element
align
{boolean
}
.setUseStandardHighlighting(useStandardHighlighting)
Set whether or not standard highlighting should be used when rendering rows.
useStandardHighlighting
{boolean
}
.setWidthProvider(widthProvider)
Sets the width provider element. The provider is only used on redraw and as such will not automatically update on resize.
widthProvider
{Node
}
.show()
Show the object.
.startRenderingRows_
[protected] {number
}The time that the rendering of the menu rows started