-
Notifications
You must be signed in to change notification settings - Fork 145
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
Best way to handle updating the options and removing the autocomplete #30
Comments
i second that. it would be nice if there were methods similar to (unless im missing something obvious) to update()/disable()/destroy() |
Is there still no way to do this? It still seems to be a problem. I'm looking into using EDIT: This is probably a good native alternative. |
Can you tell me why all of your blog email is coming to me? It is annoying! Please remove me from your mail list!!!!
|
This extension uses the Jquery UI autocomplete function. It just needs some extra work to extend out the update, create, disable, destroy... etc. methods. Anyone willing to do it? |
To whatever wayward soul may wander here in future: don't use this library. Anything you want to do with this can be done just as easily with the native jQueryUI widget Creating$("#foo").autocomplete({ source: [ ... options here ... ] }); Reacting to a selection$("#foo").on("autocompleteselect", function(event, ui) {
var selectedOption = ui.item["value"];
// Do something based on the selection.
$.ajax({ ... whatever ... }); Updatingvar newOptions = [ ... whatever ... ] // Maybe you got these from an AJAX call?
var foo = $("#foo");
foo.autocomplete("destroy");
foo.autocomplete({ source: newOptions }); Go forth, and may your Forms be beautiful. |
fosskers. While I'm pretty sure this library extends jQuery UI's Autocomplete, I am pretty much on board with you at this point. I can't figure out how to do simple updates, selects, triggers etc. I was just thinking about converting back to UI's autocomplete. The only question I have is can UI's autocomplete do the whole alternative spelling and weighted selection? I'd love if someone could type in "US" and have it select "United States" for example. I've been running down bugs in my project for days, and they are all related to getting this library to work. |
Unfortunately alternate spellings, etc, is where this library shines. The native |
Thanks for you help. Here is my working example with alternative spelling: I choose to display the label to the user, and then submit the value in a hidden field. This method will match the label, value or alternative spelling. It will also prevent from a user entering an invalid choice. I might even add the relevancy booster as well, but I'm not sure about that one yet. Now all my problems will be solved! |
@ajquick your working example is not working. Any updates for this topic. The update function is important and it's missing... |
@craigcosmo Just use the native jQuery widget, this library isn't really maintained. |
Hey guys,
I have two quick questions:
What would be the best way to update the options used in the autocomplete? This can be easily achieved by running
extract_options()
again, but how can this be run at any time by the user and still have access tocontext
?Similarly, should a function be incorporated to destroy the selectToComplete functionality?
The text was updated successfully, but these errors were encountered: