Any code that pulls 'val' from the select2 change event object will not run with the setSelect2Data command. To fix, and kill a line of code, you can do:
$(selector).select2("data", data, true);
//$(selector).trigger("change"); // not needed when true is set above.
Any code that pulls 'val' from the select2 change event object will not run with the setSelect2Data command. To fix, and kill a line of code, you can do:
Thanks