Replies: 1 comment
-
Hi @rez0n, Thanks for reaching out. I am always happy to help a sponsor :) If select2 doesn't know the item, you can't select it. Since we are loading items asynchronously, this will be the default case. However, you can mitigate this, by simply adding the item (if it doesn't exist) before selecting it. Select2 has some documentation on that, which might help you out: Best Joe! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I need to select value programmatically on a page using JS.
It is possible to do using jQuery using this code
But it is possible to select it this way only in case if you have been already selected it manually before, it is looks like select2 don't have element
id
before you select it manually.So, I select a needed user in the list, then select another user, and only after this I can change selection to the previous user programmatically.
Have any ideas on how to solve this?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions