Hello,
I'm trying to pass some parameters to aui.select2() method, but it seems that no parameter is taken into account. For instance, the following code:
AJS.$("#select2-example").auiSelect2({
placeholder: "Select an option"
});
The JSFiddle is there:http://jsbin.com/wolaxuyare/1/edit
Any idea? Thanks a lot!
Fred
Community moderators have prevented the ability to post new answers.
Frédéric Tardieu I think there might be an issue in how we wrap Select2 within AJS. I'm guessing we don't pass options through correctly. Whether this is by design or accident, I'm not sure. I'll chase it up.
I Sean, TTheB was right, adding an empty <option></option> solves the placeholder text option problem, as stated in Select2 documentation. Moreover, I'm now using other select2 options like formatResult and formatSelection, and it works fine, so I think there is no problem in the way AUI passes the options (according to select2 documentation).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When placeholder is used for a non-multi-value select box, it requires that you include an empty
<option></option>
tag as your first option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot T the B ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.