Page MenuHomeGitPull.it

class JX.Tokenizer
Javelin Documentation ()

A tokenizer is a UI component similar to a text input, except that it allows the user to input a list of items ("tokens"), generally from a fixed set of results. A familiar example of this UI is the "To:" field of most email clients, where the control autocompletes addresses from the user's address book.

JX.Tokenizer is built on top of JX.Typeahead, and primarily adds the ability to choose multiple items.

To build a JX.Tokenizer, you need to do four things:

  1. Construct it, padding a DOM node for it to attach to. See the constructor for more information.
  2. Build a {@JX.Typeahead} and configure it with setTypeahead().
  3. Configure any special options you want.
  4. Call start().

If you do this correctly, the input should suggest items and enter them as tokens as the user types.

When the tokenizer is focused, the CSS class jx-tokenizer-container-focused is added to the container node.

Tasks

Builtin Events

  • static listen(type, callback) โ€” Listen for events emitted by this object instance. You can also use the static flavor of this method to listen to events emitted by any instance of this object.

Other Methods

  • construct(containerNode)
  • private _onbrowse(e) โ€” Emitted when the value of the tokenizer changes, similar to an 'onchange' from a <select />.

Methods

static listen(type, callback)
Inherited

JX.Base

Listen for events emitted by this object instance. You can also use the static flavor of this method to listen to events emitted by any instance of this object.

See also JX.Stratcom.listen().

Parameters
type
callback

construct(containerNode)

This method is not documented.
Parameters
containerNode

private _onbrowse(e)

Emitted when the value of the tokenizer changes, similar to an 'onchange' from a <select />.

Parameters
e