Class: TagsInput

TagsInput

new TagsInput(uri, opt_createNew, opt_autocompleteRenderer, opt_inputId, opt_xhrIo, opt_xmlHttpFactory, opt_useSimilar, opt_domHelper)

This class provides a component to manage tags. It was inspired by the the jquery plugin from Tim Schlechter.
Parameters:
Name Type Argument Description
uri goog.Uri The server resources to use for fetching a list of existing tags. You can add custom parameters to uri to pass to the server with every request
opt_createNew boolean <optional>
Whether to allow a user to create new tags if the autocomplete didn't match anything. Default: false
opt_autocompleteRenderer plana.ui.ac.AutoCompleteRenderer <optional>
The renderer for the autocomplete input
opt_inputId string <optional>
Optional id to use for the autocomplete input element. Default: ''
opt_xhrIo goog.net.XhrIo <optional>
Optional XhrIo object to use. By default we create a new instance
opt_xmlHttpFactory goog.net.XmlHttpFactory <optional>
Optional factory to use when creating XMLHttpRequest objects
opt_useSimilar boolean <optional>
Use similar matches. e.g. "gost" => "ghost". This option is passed along to the server
opt_domHelper goog.dom.DomHelper <optional>
The dom helper
Source:
See:

Extends

  • goog.ui.Component

Members

<static> DEFAULT_TAG_CSS :string

The default css class to use for rendering tags
Type:
  • string
Source:

<static> EventType :string

List of events dispatched by this component
Type:
  • string
Properties:
Name Type Description
INVALID string The event dispatched if the component does not allow a user to create tags and the token entered does not match any existing tags
ADDED string The event dispatched after a tag was added
REMOVED string The event dispatched after a tag was removed
Source:

<static> FADE_SPEED :number

The default speed to use for the fade-in/out animations
Type:
  • number
Source:

<static> MSG_ADD_TAG_PLACEHOLDER

The placeholder message to display in the input. Set to an empty string to disable placeholder text
Source:

Methods

allowCreateTags(newValue)

Setter for whether we allow the creation of new tags or not
Parameters:
Name Type Description
newValue boolean The value to set to
Source:

canDecorate(element) → {boolean}

This component does not support decoration for now, because the underlying autocomplete doesn't support it
Parameters:
Name Type Description
element Element Element to decorate
Source:
Returns:
Return false
Type
boolean

createDom()

Source:

disposeInternal()

Source:

enterDocument()

Source:

exitDocument()

Source:

focus()

This function focuses the autocomplete input of this component
Source:

getAutoComplete() → {plana.ui.ac.AutoComplete}

Getter for the autocomplete component
Source:
Returns:
Type
plana.ui.ac.AutoComplete

setCaseInsensitive(newValue)

Setter for whether we should be case sensitive when checking for existing tags
Parameters:
Name Type Description
newValue boolean The value to set
Source:

setInputSize(width)

Setter for the width of the input element for the autocomplete input
Parameters:
Name Type Description
width number The width to set the input element to
Source:

setModel(model)

Parameters:
Name Type Description
model * A tag list or null to clear all tags
Source: