bootstrap-ajax-typeahead icon indicating copy to clipboard operation
bootstrap-ajax-typeahead copied to clipboard

Default ajax option is not null

Open wimski opened this issue 9 years ago • 1 comments

In the option table it says the ajax option (whether object or string) is null by default. This isn't true, because in the $.fn.typeahead.defaults the ajax option is a predefined object. So unless you specifically tell your instance to have an ajax option of null, the ajax option will not be null. I came across this when the sorter method didn't seem to work. It turns out the sorting is skipped when the ajax option is set. I only used the source option, but it didn't sort until I specifically set the ajax option to null.

So either have the default value actually be null or edit the options table in the documentation to reflect the predefined ajax object.

wimski avatar May 02 '16 12:05 wimski

Created a pull request for this issue. I added an extra check to see if the url property of the ajax option is set: pull request #40 Also added support for sorting objects.

wimski avatar May 02 '16 13:05 wimski