Skip to content

Commit

Permalink
Update docs for v0.10.1 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Harding committed Feb 9, 2014
1 parent 6409e65 commit 66debdd
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions doc/jquery_typeahead.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ Sets the value of the typeahead. This should be used in place of `jQuery#val`.
$('.typeahead').typeahead('val', myVal);
```

#### jQuery.fn.typeahead.noConflict()

Returns a reference to the typeahead plugin and reverts `jQuery.fn.typeahead`
to its previous value. Can be used to avoid naming collisions.

```javascript
var typeahead = jQuery.fn.typeahead.noConflict();
jQuery.fn._typeahead = typeahead;
```

### Options

When initializing a typeahead, there are a number of options you can configure.
Expand Down Expand Up @@ -133,12 +143,15 @@ Datasets can be configured using the following options.
how, see [Bloodhound Integration](#bloodhound-integration). **Required**.

* `name` – The name of the dataset. This will be appended to `tt-dataset-` to
form the class name of the containing DOM element. Defaults to a random
form the class name of the containing DOM element. Must only consist of
underscores, dashes, letters (`a-z`), and numbers. Defaults to a random
number.

* `displayKey` – The key used to access a suggestion object's string
representation. If a suggestion is selected, its string representation is
what the typeahead's value is set to. Defaults to `value`.
* `displayKey` – For a given suggestion object, determines the string
representation of it. This will be used when setting the value of the input
control after a suggestion is selected. Can be either a key string or a
function that transforms a suggestion object into a string. Defaults to
`value`.

* `templates` – A hash of templates to be used when rendering the dataset. Note
a precompiled template is a function that takes a JavaScript object as its
Expand Down

0 comments on commit 66debdd

Please sign in to comment.