Can we include only static options through 'options' attribute without any remote loading of data?
function createadminUserSuggest(options, selector) { var $commselect = $(selector).selectize({ "onChange": getValue, "valueField": "id", "labelField": "name", "searchField": "name", "create": false, "options": userEmailList, "openOnFocus": false, "closeAfterSelect": true, "render": { option: function(item, escape) { return ( "
function init() {
$.ajax({
"url": "/maintain/communication/get-recipient-list",
"dataType": "json",
success: function(res) {
console.log(res.data);
userEmailList = res.data;
}
});
createadminUserSuggest(userEmailList, "#user_search");
}
This is my code. I don't want any remote data to be loaded as and when user starts typing in the input box. Instead, the 'options' should be provided to the user from the pre-provided options in 'userEmailList'. Does this code work for me. I am not getting the autsuggestions while types. can anyone help with this?
Can anyone please revert to me.. I need this urgently by end of the day.. @brianreavis please reply.. Thanks in advance..
Asynch programming error: you need to call createadminUserSuggest from within the success function so that it has access to the value of userEmailList.
closing stale issues older than one year. If this issue was closed in error please message the maintainers. All issues must include a proper title, description, and examples.