title: Typeahead TypeError: it.toLowerCase is not a function
body: <p>Good day. Please take a look at my scrit first. </p>
  
  <p>My JS</p>
  
  <pre><code>$(document).ready(function(){    
      $("#outlet").typeahead({
           source: function(query, process) {
  
                  $.ajax({
                   url: '&lt;?=base_url();?&gt;graph/outletlists',
                   data: {outlets:$("#outlet").val()},
                   type: 'POST',
                   dataType: 'JSON',
                   success: function(data) {
                            process(data);
                            console.log(data);
                          }               
                      });
           },
          minLength: 2
      });
  }); 
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>function outletlists()
      {
          extract(populateform());
          $hasil = $this-&gt;modelmodel-&gt;showdata("SELECT Outlet from transaksi where outlet like '%".$outlets."%' group by Outlet");
          echo json_encode($hasil);
      }
  </code></pre>
  
  <p>and my form </p>
  
  <pre><code> &lt;div class="form-group"&gt;
           &lt;label class="col-sm-3 control-label"&gt;Outlet&lt;/label&gt;
                &lt;div class="col-sm-5"&gt;
                     &lt;input type="search" id="outlet" class="form-control" placeholder="Search..." data-provide="typeahead" /&gt;
                &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>so, I'm using <a href="https://github.com/bassjobsen/Bootstrap-3-Typeahead" rel="noreferrer">Bootstrap3-typeahead</a>. From my script above i got this error  </p>
  
  <p>from <code>console.log(data)</code> i already have my desired result. So my problems are i can't see any suggestion and then i got this error from <code>firebug</code></p>
  
  <pre><code>return ~it.toLowerCase().indexOf(this.query.toLowerCase());
  </code></pre>
  
  <p>This is what i got when i input <code>AR</code></p>
  
  <pre><code>[{"Outlet":"K-AR3"},{"Outlet":"K-AR4"},{"Outlet":"K-ARN2"},{"Outlet":"K-ARN3"}]
  </code></pre>
  
  <p>any help would be appreciated, sorry for my bad english. </p>
  
  <p>I try it to make it like the example at <a href="http://twitter.github.io/typeahead.js/examples/" rel="noreferrer">http://twitter.github.io/typeahead.js/examples/</a></p>
  
  <pre><code>var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
    'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii',
    'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
    'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota',
    'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',
    'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
    'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island',
    'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont',
    'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'
  ];
  $(document).ready(function() {
      $("#outlet").typeahead({
          autoSelect: true,
          minLength: 2,
          delay: 400,
          source: states
      });
  });
  </code></pre>
  
  <p>and it works . </p>
  
  <p>Results from <code>firebug</code></p>
  
  <blockquote>
    <p>POST <a href="http://localhost:84/new_store/graph/outletlists" rel="noreferrer">http://localhost:84/new_store/graph/outletlists</a>   200 OK         375ms<br>
    jquery-....min.js (line 4) HeadersPostResponseHTMLCookies</p>
    
    <p>[{"Outlet":"K-AR3"},{"Outlet":"K-AR4"},{"Outlet":"K-ARN2"},{"Outlet":"K-ARN3"}]</p>
    
    <p>TypeError: b.toLowerCase is not a function    </p>
    
    <p>...on(a){var
    b=this.displayText(a);return~b.toLowerCase().indexOf(this.query.toLowe...</p>
    
    <p>bootstr....min.js (line 1, col 2903</p>
  </blockquote>
  
  <p>I try to change my <code>bootstrap3-typeahead.js</code> to <code>bootstrap3-typeahead.min.js</code> end my error become like this</p>
  
  <blockquote>
    <p>TypeError: b.toLowerCase is not a function ...on(a){var
    b=this.displayText(a);return~b.toLowerCase().indexOf(this.query.toLowe...</p>
  </blockquote>