I am using select2 version 4.0, and I am trying to make a programmatic selection to a select box which gets its data from an ajax call.
In the documentation, I found how to set a value programmatically to a regular select2, but I can't figure out how to do this with an ajax select.
If I remember correctly, in the old version, you could set the current value by passing a data to the select2 with this command:
jQuery("selectbox").select2("data", data)
I've tried this, and sent a data object with, id, text and result, but nothing visible happens, and when I query the status of the select box, to see the selected values, it returns null.
Was this option removed, or simply changed? Where can I find this in the documentation, or how could I achieve the desired behaviour?