Docs for: Does Select2 include extra information in these events? - #4583
Docs for: Does Select2 include extra information in these events?#4583guettli wants to merge 1 commit into
Conversation
| {% highlight js linenos %} | ||
| $(function() { | ||
| $('#mywidget').on('select2:select', function(evt){ | ||
| alert(evt.params.data.mydata); |
There was a problem hiding this comment.
Ideally this wouldn't necessarily be documenting the fact that you can send back additional data on the selected data object, but instead it would be documenting the fact that evt.params.data exists on select2:select. Select2 passes a bunch of data along with events through evt.params, and the end goal for this section was to document that.
There was a problem hiding this comment.
I am happy that I found evt.params.data. I would like to share this information and provided this pull request. Please alter my pull request, if you think it can be improved. How do you want this change to look like?
|
Hi Kevin. This pull request is still open. If you don't want to use my proposal, then what do you suggest? It took me some time to find this. It would be nice to fill the place holder in the docs. |
|
I have now added this to the new docs: https://select2.org/programmatic-control/events#event-data |
This pull request includes a
The following changes were made
Added docs for "Does Select2 include extra information in these events?"
Related: http://stackoverflow.com/questions/39333354/select2-how-to-add-extra-information-for-selected-item