How to set display value in typeahead.js -


i set twitter typeahead display description different key value.

$('#scrollable-dropdown-menu .typeahead').typeahead({         hint: true,         highlight: true,         minlength: 1     },     {         name: 'searchproduct',         source: bloodhoundds.ttadapter(),         displaykey: 'descr',         valuekey:"productid",         limit: 20     }); 

how can preselect display value if have productid

i've try

$('.typeahead').val("2200718"); 

and

$('.typeahead').typeahead('val', "2200718").trigger('change'); 

all can see in field id value instead description.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -