Hi team,
i'm confusing about this feature. In documentation about Select2 we have this code:
var $exampleMulti = $(".js-example-programmatic-multi").select2();
and
$exampleMulti.val(["CA", "AL"]).trigger("change");
In Atlassian (AuiSelect2) this doenst work. Your have any example how i do this via javascript? The Atlassian AUI Documentation dont have examples for that feature...
Thanks.
links:
Multiselect2 and Select2: https://select2.org/programmatic-control/methods
Atlassian AUI Select2: https://docs.atlassian.com/aui/7.8.0/docs/auiselect2.html
I solved the problem this way
var data = ["value1","value2"];
var element = AJS.$('#multiselect2Id").auiSelect2();
element.val(data).trigger('change');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.