I have this select2:
$('#order_address_select').select2({
placeholder: "Sratr typing...",
ajax: {
url: 'mysite/myurl',
dataType: 'json',
},
tags: true,
});
And then I am trying to add options dynamically
var newOption = new Option('myoption',1,false,false);
$('#order_address_select').append(newOption).trigger('change');
$('#order_address_select').select2('open');
new option appends in my <select></select>
tag, but nothing appears in dropdown list. How do I resolve this?