Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the same issue when i tried to process username and id.I had a tricky fix but later on i have fixed it with proper solution.</p> <p>Have a look at this one,</p> <pre><code>$('#search').typeahead({ source: function(query, process) { var $url = "/controller/function/list_users/?q="+query; var $datas = new Array; $datas = [""]; $.ajax({ url: $url, dataType: "json", type: "GET", success: function(data) { $.map(data, function(data){ var group; group = { id: data.id, name: data.user_name, toString: function () { return JSON.stringify(this); //return this.variable; }, toLowerCase: function () { return this.name.toLowerCase(); }, indexOf: function (string) { return String.prototype.indexOf.apply(this.name, arguments); }, replace: function (string) { var value = ''; value += this.name; if(typeof(this.name) != 'undefined') { value += ' &lt;span class="pull-right muted"&gt;'; //value += this.name; value += '&lt;/span&gt;'; } return String.prototype.replace.apply('&lt;div style="padding: 10px; font-size: 1em;"&gt;' + value + '&lt;/div&gt;', arguments); } }; $datas.push(group); }); process($datas); } }); }, property: 'user_name', items: 10, minLength: 2, updater: function (item) { var item = JSON.parse(item); $('#hiddenId').val(item.id); $('#username').val(item.name); //you can perform your actions here //example&lt;/p&gt; //location = '/controller/function/'+item.id+'/edit'; //document.redirect = location; } }); </code></pre> <p>look at this link also.</p> <p><a href="http://vaisakhvm.wordpress.com/2013/07/31/twitter-bootstrap-typeahead-process-multiple-values/" rel="nofollow">http://vaisakhvm.wordpress.com/2013/07/31/twitter-bootstrap-typeahead-process-multiple-values/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload