Skip to content
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 support #12

Open
microweber opened this issue Nov 18, 2011 · 4 comments
Open

Ajax support #12

microweber opened this issue Nov 18, 2011 · 4 comments
Labels

Comments

@microweber
Copy link

Can i load the haystack by ajax and use the server to pass suggestions on every keystroke?

@polarblau
Copy link
Owner

I'm afraid not. The README comments on this, but the reason for not implementing this so far is the fear, that an AJAX request would simply often be too slow. Since the results are displayed inline, this might cause some problems.

You never know — I might give it a try sometime soon, though, anyways. Let's see.

@microweber
Copy link
Author

Yep they might be slow. ANyway the server can respond witch cached results for speed.

I will be happy to see it someday. maybe i can sit to try to make it

@microweber
Copy link
Author

How can i access the suggestions array? https://github.com/ooyes/suggest/blob/master/src/jquery.suggest.js

Also is there a way to make the array global?

so i will make seperate funtion to refresh it on keyup


     var suggestions = []; must be inside the settings array

var settings = $.extend({
      suggestions :[]

    }, options);

@polarblau
Copy link
Owner

If you want to give it a try, please be my guest. A feature branch in case of a pull request would be highly appreciated, though.

You currently set the suggestions array via the source parameter. That's a convenience solution and there no difference between setting it via the settings option or as it's currently implemented.

You gave me an idea, however: I'm considering to enable the passing of a function as alternative to the array. Like this you could manipulate the suggestions after initialization. Just wondering if this maybe really is the functionality of a "different plugin".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant