Typeahead.js: Limit not working

Created on 8 Jul 2014  路  2Comments  路  Source: twitter/typeahead.js

Hi Im new to using this Typeahead plugin and so far it great..

im using Bootstra3-typeahead.js plugin ( is it different from twitter typeahead plugin??)

I am facing an issue currently... No matter i set the Limit option to 10 or 20.. .. only 8 suggestions are being shown by typeahead in dropdown.. The Ajax json set return around 100 to 150 suggestions... here is the code.. please help..
I wanted to show all the results.. auto scroll bar is fine

2014-07-02_16-47-35

var issuers;
var issuances;

         $('#<%=txtIssuer.ClientID %>').typeahead({
             limit: 30,
             minLength: 3,
             source: function (query, process) {
                 searchIssuer(query, process);
             },
             updater: function (item) {
                 var issuer = _.find(issuers, function (c) {
                     return c.IssuerName == item;
                 });
                 return issuer.IssuerId;
             }
         });

         var searchIssuer = _.debounce(function( query, process ){

             return $.ajax({
                 type: "POST",
                 url: '/Lookups.asmx/GetIssuers',
                 data: JSON.stringify({ query: query }),
                 contentType: "application/json; charset=utf-8",
                 dataType: "json",
                 success:
                          function (data) {
                              issuers = data.d;
                              var issuerNames = _.map(issuers, function (c) {
                                  return c.IssuerName;
                              });
                              return process(issuerNames);
                          }
             });

         }, 500);
     });

Most helpful comment

false:

limit: 30

true:

items: 30

All 2 comments

looks like bootstrap typeahead is not supported.. i will use twitter typeahead

false:

limit: 30

true:

items: 30

Was this page helpful?
0 / 5 - 0 ratings