tcrosen/twitter-bootstrap-typeahead — pull request #12 by clj (2012-08-13 16:04:57+00:00)
Title: Add full item to call of match and highligther

The fact that the matcher and highlighter functions only get passed the 'display value' of an item, and not the entire item makes some desirable things impossible to do. My use case is that I have a field into which usernames are typed. However, I have the users full names and need to be able to match on these. Since the input only accepts the login, it is not good enough just having the full name as the item's 'display value', I therefore need the matcher and the highlighter to have full access to the item, to which I can add arbitrary data such as the full name (and anything else I please).

The attached changeset passes the full item to the matcher and highlighter functions. The change ought be compatible with all users custom matcher and highlighter functions unless they have done something very exotic. One could also choose to pass just the full item and be incompatible with existing code...