jquery - Typeahead Array as valueKey -
i using typeahead until tried pass array valuekey. works until tag. i'd able type "astronomy" or "science" either of values of array in tag. missing something, or typeahead not support this? there different way can achieve this?
jsfiddle: http://jsfiddle.net/sr4136/gcutj/
$(".programs-search .text").typeahead([ { name: 'programs', local: json, limit: 10, valuekey: 'tag', template: '<p>{{name}} - {{degree}}</p>', engine: hogan } ]);
here object:
var json=[{ "name":"astronomy , physics", "degree":"bs", "school":"sad", "discipline":"the sciences", "location":"classroom", "tag":["astronomy","science"] }];
your value key should "name", , call "tag" should called "tokens". that's it.
Comments
Post a Comment