twitter/bootstrap — Issue #1871: Typeahead only works on arrays of strings
Author: quasipickle
Created: 2012-02-09 17:12:40+00:00
State: open

It would be nice if Typeahead allowed arbitrary data sources without needing to redefine sorter/matcher/highlighter.

This could be accomplished with 2 additional options:

1. `get()`: would get passed an item, and it returns the value to match & sort against. The built-in would just return the item
2. `getDisplay()`: would get passed an item, and it returns the value to display. The built-in would just return the item.

The built-in matcher & sorter functions would then use `this.get(item)` rather than just `item`.
The built-in highlighter function would use `this.getDisplay(item)` rather than just `item`