Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with AUI Select2 initialization

Ivana Navratilova
Contributor
February 13, 2018

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();

ScreenHunter_1.jpg

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.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events