Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed highlighter bug. #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.markdown
Expand Up @@ -28,6 +28,9 @@ There are a few options to make this a bit more flexible. To use these, make the
- `ajax.displayField`
If the data returned from the server is a list of objects (as opposed to an array of strings), set this member to the name for the field to use for display.

- `ajax.valueField`
If the data returned from the server is a list of objects (as opposed to an array of strings), set this member to the id data for the item into list (*required* for a list of objects).

- `ajax.triggerLength`
This is the minimum length of text to take action on. Default is at 3.

Expand All @@ -51,10 +54,14 @@ There are a few options to make this a bit more flexible. To use these, make the

```javascript
$("#ajax-typeahead").typeahead({
onSelect: function(item) {
console.log(item);
},
ajax: {
url: "/path/to/source",
timeout: 500,
displayField: "name",
valueField: "id",
triggerLength: 1,
method: "get",
loadingClass: "loading-circle",
Expand All @@ -79,7 +86,7 @@ $("#ajax-typeahead").typeahead({
```

Enjoy!

Contact
-------

Expand Down