arosequist / om-autocomplete

An autocomplete component for Om
Apache License 2.0
61 stars 9 forks source link

om-autocomplete

An autocomplete component for Om.

Examples

Components

Here's a mockup of a basic autocompleter:

The arosequist.om-autocomplete namespace contains a single function, autocomplete, which is an Om component that handles the core autocomplete logic, but does not directly render any DOM elements. Instead, you give it three main components:

  1. The container view just holds the other two components. Typically, this will render a simple wrapper div.
  2. The input view is responsible for taking user input.
  3. The results view displays the suggestions that were generated based on the input.

Some important terms are:

Details

The options for autocomplete are (as keywords):

Bootstrap

om-autocomplete contains some convenience functions for pages that are using Twitter Boostrap. They are located in the arosequist.om-autocomplete.bootstrap namespace. TODO: More documentation here

Much of the code in this namespace isn't Bootstrap-specific, and I expect to create other helper namespaces for common use cases.