ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Support for async calls #4

Closed andrejkaurin closed 9 years ago

andrejkaurin commented 9 years ago

Common request is that data source is queried while user types. Does this widget supports that. Original mentions input had onDataRequest and callback so it was easy to implement ajax calls.

ivirabyan commented 9 years ago

Yes, you can use the source option. This option is passed to the jQuery Autocomplete plugin, so you can pass any value supported by jQuery Autocomplete. See http://api.jqueryui.com/autocomplete/#option-source for available values. To implement ajax, you just do something like this $('textarea').mentionsInput({source: 'http://example.com/autocomplete/'})