-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
coffee/chosen.proto.coffee
Outdated
@@ -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}) |
There was a problem hiding this comment.
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).
Sorry about those outdated diff errors. Fixed now. |
coffee/chosen.proto.coffee
Outdated
@@ -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}) |
There was a problem hiding this comment.
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.
I believe this has been discussed before and would've been a performance killer.. |
Closing, too old |
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.