I have an app with jQuery typeahead and the typeahead multiselect extension.
On load I would like certain elements to be selected by default, how do I do that?
$(document).ready(function() {
waitingDialog.hide();
$("#typeahead").typeaheadmulti({
minLength: 1,
hint: false,
highlight: true,
autocomplete: false,
}, {
name: 'Typeahead',
source: function(query, syncResults, process) {
var args = {};
args.Str = query;
gers = aj("Search", function(res) {
names = [];
ids = {};
res.d = JSON.parse(res.d);
$.each(res.d,
function(i, lkp) {
names.push(lkp.name.trim().toUpperCase());
});
process(names);
}, JSON.stringify(args), null);
},
limit: 10
})
});