typeahead.js icon indicating copy to clipboard operation
typeahead.js copied to clipboard

Suggestion: Setting to change "value" key

Open scott-laursen opened this issue 13 years ago • 4 comments

Use case: I am using an existing API to fetch data for the typeahead. The data from the API does not contain a key called "value". It does however have another meaningful key called "name" I would like to use.

Suggestion: To have a property where we can set the value key, so we do not have to write wrappers for existing API's.

$(element).typeahead([{
    name: 'source1',
    remote: '/api/search?q=%QUERY',
    valueKey: 'name'
}]);

scott-laursen avatar Feb 27 '13 18:02 scott-laursen

:+1:

jharding avatar Feb 27 '13 18:02 jharding

I can tackle this.

vskarich avatar Feb 28 '13 02:02 vskarich

Yea, I guess it should allow to set a Datums (not only the value key) the same as a custom template can already be provided as a option...

adardesign avatar Feb 28 '13 21:02 adardesign

Delaying this to v0.9.

jharding avatar Mar 03 '13 00:03 jharding