0

So I'm using the Simpliq theme for Bootstrap, and it has a typeahead component in the form. It requires that I use a "data-source" field with an array of values. Unfortunately, the dataset I have is in the hundreds, and it will substantially slow down page loading, if not time it out completely.

My question is, is there a data-remote or something I could use to fetch data-set based on entered term in the text field without having to use a "data-source" array? I don't want to place the whole data-set in the typeahead field.

I'm using MySQL to fetch the field "property_no" from three different tables, each with their hundred rows.

Siguza
  • 21,155
  • 6
  • 52
  • 89

1 Answers1

0

According to the documentation - http://getbootstrap.com/2.3.2/javascript.html#typeahead, source can also be configured (manually) to be a function and

The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.

And this SO question shows you how exactly to get the options asynchronously - twitter bootstrap typeahead ajax example

Community
  • 1
  • 1
potatopeelings
  • 40,709
  • 7
  • 95
  • 119