ivaynberg/select2 — pull request #85 by asolove (2012-06-07 18:24:57+00:00)
Title: Support not showing search input

Thanks for this great plugin which we hope to use for all our custom selects. Sometimes we have very small selects with only a few options, and we really don't need the search input field. We just want to duplicate the browser select in a skinnable way.

This commit adds a ```showSearch``` option, which defaults to true but can be set to false, which allows for a single-select to display without a text entry field. When this option is set to false:

- the search field is displayed off-screen but on the dom
- when the select is open, typing does not filter the results list, but does highlight the first item to match the search
- when the search fails to match, reset it to empty so user can begin search again, as in browser selects

A few questions:

- is this option in line with your vision for the library?
- is there an easier way to find the dom element for a result item if we have the item's id? I'm doing a lot of data lookups, which are slower than necessary. If there isn't a better way currently, perhaps we can add an actual data-id attribute so we can find the item with one css query.

Thanks again for this great plugin. Hope we can give back some in return for using it.