Select2 simple example not working properly

Hello community

i’m trying to add Select2 to my gadget , i followed this documentation , but still looks like this


this is my code :

<script src="//"></script>
<link rel="stylesheet" href="" media="all">
<script src=""></script>
<script src="//"></script>
<script src=""></script>
<script src="//" type="text/javascript"></script>
<script type="text/underscore-template" id="dashboardItemConfigTemplate">
    <form class='aui'>
            <select id="select2-example" >
                <option value=""> </option>
                <option value="1">option 1 </option>
                <option value="2">option 2 </option>
                <option value="3">option 3 </option>
 <script type="text/javascript">

what i m missing please !
thnak you .

Hi @hamzabouallegue,

When this code AJS.$("#select2-example").auiSelect2(); executes, it expects to find the element in DOM.

From the given code it looks like it only exists as string within text/underscore-template.


1 Like