-
Notifications
You must be signed in to change notification settings - Fork 51
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
How to get the last selected item #34
Comments
I've checked amd version and it works. Maybe there is some issue with non-amd version. |
It worked when I used your last submit and placed .on event like in the example you provided. I can now see the selected option in the console. Thank you! However, I have another issue when I try to use the selected option. I am trying to change the selected select2 options programmatically based on the selection when a selection is made, but I can't refresh the drop-down because triggering change events apparently does not fire in the 'on' block. The drop-down only refreshes itself when I make another selection or close/reopen the drop-down. I am using 'change.select2' as suggested here too, but it doesn't work. Should I use a different namespace/tag here other than 'change.select2' or 'change'? Or should I use another approach to solve this problem? (The main goal is adding an 'All options' option, which will clear all other selections if it is selected).
|
I am trying to get the last selected item by listening to the
select2:select
event as suggested here, but I could not make it work.Is this kind of event listening not supported?
This does not work either:
But this works:
(select2 version 4.x)
The text was updated successfully, but these errors were encountered: