-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AJAX data sources and multiple tokens #16
base: master
Are you sure you want to change the base?
Conversation
Added an onFilterChanged callback which is called whenever the filter expression changes. This can fetch data remotely and use the setValues to populate the newly updated set of values. An example of using this to show Github repositories is included in the demo page.
Tokens can be passed in as an array. The token that was matched is passed into the elementFactory as well as the onFilterChanged callback
Thanks for that, you saved me. Note that this code is not compatible with IE8, without changes. The forEach needs changing to a regular for loop, and you need some polyfills..
Also note the code is not compatible with jfelsinger's second token delimiter regexp workaround in #6. That's fine though, that was kind of a hack. The first token delimiter workaround (removing \b) still works. |
Thanks, will try dig out a copy of IE8 and patch and test on that as soon as I get a chance |
Oh, actually I assumed that this was a problem in your code, and I just realised it wasn't - it's an original 'bug' (incompatibility, really) in sew. Sorry for pinning it on you ;). |
Why don't you accept this PR? |
I've added some functionality that I needed, not sure if you'd like to pull these upstream.
You can fetch data remotely using an onFilterChanged callback and a setValues call. You can also specify a list of tokens to match (e.g. ["@", "#"]). I've added a demo for both of these functions in the demo.html