jonatasdaniel
jonatasdaniel

Reputation: 193

Bootstrap3 typeahead limit

I'm using bootstrap3 typeahead but I have some situations when my API return a lot of results (about 40) but typeahead just pop ups 8 results.

I tried to solve this using

limit: 30

but it didn't work.

How can I change it to show more than just 8 results?

BTW, my typeahead is

$('#postcode').typeahead({
  source: function (query, process) {
    var ajaxResponse;
    $.ajax({
      url: "my_url",
      type: "GET",
      cache: false,
      success : function (response) {
        process(response.addresses);
      }
    });
  },
  limit: 30,
  minLength: 2,
  displayText: function(item) {
    return item.full_description;
  },
  updater: function(item) {
    // some func here
    return item;
  }
});

Upvotes: 0

Views: 943

Answers (1)

Thomas
Thomas

Reputation: 93

It's not "limit" that you are looking for, but rather "items". Change that and it will work.

You can either give a particular number of items, or just specify "all".

Upvotes: 4

Related Questions