Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to correctly use AUI Select2?

anton ronin May 24, 2015

i have difficult to use AUI Select2 with something more complex than hard coded options. How to properly use this component?

http://jsfiddle.net/0v74wvnr/ attempt to init AUI Select2 from array.

https://bitbucket.org/anton_ronin/aui-select2-not-today attempts to init AUI Select2 from array, via ajax. Trying almost everything.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2015

Hi Anton,

You will need to declare your base element as

<input id="select2-example">

Then use the following for your declaration:

AJS.$("#select2-example").auiSelect2({
    data:options,
    multiple: true
});

Then it should work smile

anton ronin May 24, 2015

So much time, so much pain...

Like # people like this
jibranbala June 20, 2016

How to use with customfield with ajax datasource.

Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2016

AUI Select 2 uses Select2 3.5.3 in the background, so the documentation there should be able to get you started:

http://select2.github.io/select2/#ajax

Like Oleksii Skachkov likes this
TAGS
AUG Leaders

Atlassian Community Events