StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
220 stars 95 forks source link

Is it possible to delay call until user has typed a couple of characters? #52

Closed michaelsmedley closed 7 years ago

michaelsmedley commented 7 years ago

Looking at using this as an auto-suggest, but for quite a large dataset.

Rather then have the dropdown appear as soon as the user types '@', is it possible to delay it until the user types i.e. '@jan' and then have the dropdown populate with options starting with 'jan'?

Looking at the documentation it looks like this can be achieved by running a function through the source parameter, but just wanted to make sure this would be the best way to achieve it

Thanks!

StevenDevooght commented 7 years ago

As soon as you type the @ the plugin kicks in. In the source function you can choose when to call the process callback. That should do the trick.

michaelsmedley commented 7 years ago

Yep, noticed I can pull the query parameter and get the string after the '@', so passing that to a php script to filter the results - exactly what I was after!

All sorted - thanks a lot for the response!!