I am trying to use Select2 in my plugin and so far havent had much success.
I have a select, which I fill through a javascript function.
<select class="fieldSelect firstFieldSelect"></select>
JS:
$('.fieldSelect').html(options);
The options are generated from parsing some Ajax response, but it shouldnt matter. When I leave it like this, it works fine and correctly displays the normal HTML select.
But when I add the Select2 initialization after the previous line, the select turns into a gray unclickable field.
$('.fieldSelect').auiSelect2();
It seems that it can see the options filled into the select tag, since the first one is selected, but it doesnt render the selecting part at all. There are no errors or logs of any kind in the console.
I honestly feel like I am missing some tiny detail, because the component seems simple enough to use, but I cant figure out what it is.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.