-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Hi, First of all, thank you for this awesome plugin. when I am using your plugin with prefetched data then it is working fine. Showing all the result
`$('.short_code').suggest('#', {
data: text_shortcuts_array,
map: function(text_shortcut) {
return {
value: text_shortcut.text,
text: '<strong>'+text_shortcut.value+'</strong><br>'
}
},
})`
But when I am using ajax for data things are not working fine for me. I don't know where I am doing wrong
$('.short_code').suggest('#', {
data: function(q, provide) {
$.getJSON("/someurl", { q: q }, function(data) {
text_shortcuts = data;
var text_shortcuts_array = [];
$.each(text_shortcuts, function (key, value) {
text_shortcuts_array.push({
value: value['Textshortcut']['shortcut'],
text: value['Textshortcut']['text']
});
})
<!-- I am getting value here -->
provide.call(text_shortcuts_array);
});
},
map: function(text_shortcut) {
return {
value: text_shortcut.text,
text: '<strong>'+text_shortcut.value+'</strong><br>'
}
},
})`
```
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels