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
Post a Comment