Closed edwh closed 7 years ago
I don't totally understand what you're after, but is sounds like you might be wanting to load the data to search/filter only after typing @ . You can do this by overriding remoteFilter with a function that requests your data from your server and passes it to callback.
Something like...
$('#inputor').atwho({
at : "@",
remoteFilter : function (query, callback) {
$.getJSON(
"/mydataurl",{}
callback);
},
})
Ah, thanks, I hadn't appreciated what remoteFilter does.
Thanks for the very useful plugin, and apologies for raising an issue rather than doing an enhancement.
I'm using the option where data is a string to trigger loading of options over AJAX. In most of my comments, @ isn't used, and it would therefore reduce the load on my servers if the loading of the data was deferred until the @ key was pressed - even though this would introduce a slight user delay.
At the moment I'm doing this via a keypress event, and only instantiating your plugin once the @ key is pressed. That works fine, but it might be nice if there was an option for it.