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

Added Prototype version #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ndbroadbent
Copy link

Support the Prototype javascript framework.

Please also be aware that we have released an ajax-chosen-rails gem for use with Rails 3.1 applications.
This gem has been released with the prototype version included.

@meltingice
Copy link
Owner

I'm a bit confused by this. Where is the Chosen class that is being extended by ajaxChosen? Is that a part of the ajax-chosen-rails gem?

@ndbroadbent
Copy link
Author

Hi,

The Chosen class is just the original chosen javascript library. In the prototype version of chosen, you call

new Chosen(element);

So the prototype version of ajaxChosen wraps the Chosen object, but binds to the 'keyup' event on the input after chosen is initialized. You call it like this:

new ajaxChosen(element);

I'll update the README with this info too, sorry, I should have added that to the pull request


# I'm assuming that it's ok to use the parameter name `term` to send
# the form value during the ajax call. Change if absolutely needed.
query_key = options.query_key || "term"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did need to change the parameter name, so we made this configurable via a query_key option.

Do you think this ok? If so, I'll add it to the jQuery version and also fix the comment above

@manuelmeurer
Copy link

@meltingice What is the status of this PR? Can this be merged? Seems like a great addition.

@evilguc
Copy link

evilguc commented Apr 23, 2013

Too many bugs to use

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

Successfully merging this pull request may close these issues.

4 participants