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

Add 'chosen:search_results_updated' event #1626

Closed

Conversation

juanghurtado
Copy link

This event will be triggered on every update of the search results
area (via update_results_content()). It can be used, for example,
in case you need to attach extra info to your search result items.

@@ -228,7 +228,10 @@ class @Chosen extends AbstractChosen
this.winnow_results()

update_results_content: (content) ->
@search_results.update content
@search_results.html content
@form_field_jq.trigger("chosen:search_results_updated", {chosen: this})
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no such tink like @form_field_jq in the Prototype version (the _jq suffix stands for jQuery).

@juanghurtado
Copy link
Author

Sorry about those outdated diff errors. Fixed now.

@@ -229,6 +229,7 @@ class @Chosen extends AbstractChosen

update_results_content: (content) ->
@search_results.update content
@form_field.trigger("chosen:search_results_updated", {chosen: this})
Copy link
Collaborator

Choose a reason for hiding this comment

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

The mehtod is .fire in Prototype, not .trigger

This event will be triggered on every update of the search results
area (via `update_results_content()`). It can be used, for example,
in case you need to attach extra info to your search result items.
@koenpunt
Copy link
Collaborator

I believe this has been discussed before and would've been a performance killer..

@juanghurtado
Copy link
Author

Closing, too old

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.

3 participants