-
Notifications
You must be signed in to change notification settings - Fork 97
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 do you manually set the select2 value? #27
Comments
Basically, in the onSelect function, I want to show a confirm modal, and if they do not confirm, I want to return the select value to what it was previously. I have been trying to do this for looong time and tried many different names using .val Please can you help me. Do you have an example of how to manually set the select value of this component. I use this component everywhere in my app |
|
But in this case, the component properties are not updated. |
@rkit Thank you soo much!
Works! I would have never figured it out otherwise. Can you add exactly that post in the documentation under, "How to programmatically update select2" Thanks so much for the quick reply, now I can continue! |
Ok, tomorrow I will add. |
Ill close it! thanks! |
I have been trying to do this simple thing with this component and it does not work.
In the onSelect method, I want to return the value to the previous selected value.
So I am trying to manually set the select2 value.
$('.select-input').val('theValue')
but setting it with .val function does not work
Also using the .select2 method does not work because it does not exist.
How can I manually set the select2 value with this component?
The text was updated successfully, but these errors were encountered: