##

Demos

Menu Search

# Autocomplete

An autocomplete widget backed by either local or remote data can be created by leveraging the filter feature.

## Remote data

To use the filter as an autocomplete that taps into remote data sources, you can use the `filterablebeforefilter` event to dynamically populate a listview as a user types a search query: Remote autocomplete demo

## Local data

The filter reveal feature makes it easy to build a simple autocomplete with local data. When a filterable list has the `data-filter-reveal="true"`, it will auto-hide all the list items when the search field is blank. The `data-filter-placeholder` attribute can be added to specify the placeholder text for the filter.

Any filter with more than 100-200 items may be slow to perform on a mobile device so we recommend using this feature for autocomplete situations with a relatively small number of items.

### Full width listview (non-inset)

- Acura
- Audi
- BMW
- Cadillac
- Chrysler
- Dodge
- Ferrari
- Ford
- GMC
- Honda
- Hyundai
- Infiniti
- Jeep
- Kia
- Lexus
- Mini
- Nissan
- Porsche
- Subaru
- Toyota
- Volkswagen
- Volvo

### Inset listiew

- Acura
- Audi
- BMW
- Cadillac
- Chrysler
- Dodge
- Ferrari
- Ford
- GMC
- Honda
- Hyundai
- Infiniti
- Jeep
- Kia
- Lexus
- Mini
- Nissan
- Porsche
- Subaru
- Toyota
- Volkswagen
- Volvo

## Providing richer search content

By default, the filter simply searches against the contents of each list item. If you want the filter to search against different content, add the `data-filtertext` attribute to the item and populate it with one or many keywords and phrases that should be used to match against. Note that if this attribute is added, the contents of the list item are ignored.

This attribute is useful for dealing with allowing for ticker symbols and full company names to be searched, or for covering common spellings and abbreviations for countries.

    <li data-filtertext="NASDAQ:AAPL Apple Inc."><a href="#">Apple</a></li>
    <li data-filtertext="USA U.S.A. United States of America"><a href="#">United States</a></li>

- Adobe
- Amazon
- Apple
- Google
- IBM
- Microsoft
- Yahoo
- United States

- Home

- ### Getting started

  - Introduction
  - Responsive Web Design

- ### Pages

  - Pages
  - Single page
  - Multi-page template
  - Dialog page

- ### Navigation

  - Navigation
  - Linking pages
  - PHP redirect demo
  - Transitions
  - Loader

- ### Events

  - Swipe list items
  - Swipe page navigation

- ### Theme

  - Default theme
  - Classic theme
- Buttons

- ### Icons

  - Icons
  - Icons load script

- ### Toolbars

  - Toolbar
  - Dynamic toolbars
  - External toolbars
  - Fixed toolbars
  - Fullscreen toolbars
  - Fixed external toolbars
  - Persistent toolbars
  - AJAX optimized toolbars
  - Form in toolbar
  - Navbar widget
- Tabs

- ### Panels

  - Panel
  - External panels
  - Fixed panels
  - Panels responsive
  - Custom panel style
  - Panel open on swipe
  - Panel external and internal

- ### Popups

  - Popup
  - Popup alignment
  - Popup arrow size
  - Dynamic popups
  - Popups with iframes
  - Popup image scaling
  - Popup outside multi-page

- ### Collapsibles

  - Collapsible
  - Dynamic collapsibles
  - Collapsible set

- ### Listviews

  - Listview
  - Listview autocomplete
  - Listview autocomplete remote data
  - Listview autodividers linkbar
  - Listview autodividers selector
  - Listview collapsible list items (flat)
  - Listview collapsible list items (indented)
  - Listview responsive grid

- ### Tables

  - Table Column Toggle
  - Table Column Toggle demo
  - Table Column Toggle heading groups
  - Table Column Toggle options
  - Table Reflow
  - Table Reflow heading groups
  - Table Reflow stripes and strokes
  - Table Reflow custom styles
- Filterable

- ### Forms

  - Forms
  - Forms gallery
  - Forms disabled
  - Field containers
  - Hide labels
  - Textinput
  - Input button
  - Checkboxes
  - Radio buttons
  - Selectmenu
  - Custom select menu
  - Custom select menu with filter
  - Slider
  - Slider flip toggle switch
  - Slider tooltip
  - Rangeslider
  - Flipswitch

- ### Controlgroups

  - Controlgroup
  - Dynamic controlgroups

- ### Grids

  - Grids
  - Buttons in grids
  - Custom responsive grids

- ### 3rd party API

  - Backbone RequireJS
  - Google Maps geolocation
  - Google Maps list toggle

- Home

- ### Getting started

  - Introduction
  - Responsive Web Design

- ### Pages

  - Pages
  - Single page
  - Multi-page template
  - Dialog page

- ### Navigation

  - Navigation
  - Linking pages
  - PHP redirect demo
  - Transitions
  - Loader

- ### Events

  - Swipe list items
  - Swipe page navigation

- ### Theme

  - Default theme
  - Classic theme
- Buttons

- ### Icons

  - Icons
  - Icons load script

- ### Toolbars

  - Toolbar
  - Dynamic toolbars
  - External toolbars
  - Fixed toolbars
  - Fullscreen toolbars
  - Fixed external toolbars
  - Persistent toolbars
  - AJAX optimized toolbars
  - Form in toolbar
  - Navbar widget
- Tabs

- ### Panels

  - Panel
  - External panels
  - Fixed panels
  - Panels responsive
  - Custom panel style
  - Panel open on swipe
  - Panel external and internal

- ### Popups

  - Popup
  - Popup alignment
  - Popup arrow size
  - Dynamic popups
  - Popups with iframes
  - Popup image scaling
  - Popup outside multi-page

- ### Collapsibles

  - Collapsible
  - Dynamic collapsibles
  - Collapsible set

- ### Listviews

  - Listview
  - Listview autocomplete
  - Listview autocomplete remote data
  - Listview autodividers linkbar
  - Listview autodividers selector
  - Listview collapsible list items (flat)
  - Listview collapsible list items (indented)
  - Listview responsive grid

- ### Tables

  - Table Column Toggle
  - Table Column Toggle demo
  - Table Column Toggle heading groups
  - Table Column Toggle options
  - Table Reflow
  - Table Reflow heading groups
  - Table Reflow stripes and strokes
  - Table Reflow custom styles
- Filterable

- ### Forms

  - Forms
  - Forms gallery
  - Forms disabled
  - Field containers
  - Hide labels
  - Textinput
  - Input button
  - Checkboxes
  - Radio buttons
  - Selectmenu
  - Custom select menu
  - Custom select menu with filter
  - Slider
  - Slider flip toggle switch
  - Slider tooltip
  - Rangeslider
  - Flipswitch

- ### Controlgroups

  - Controlgroup
  - Dynamic controlgroups

- ### Grids

  - Grids
  - Buttons in grids
  - Custom responsive grids

- ### 3rd party API

  - Backbone RequireJS
  - Google Maps geolocation
  - Google Maps list toggle