Has anyone used and configured some basic selected.js code?
I downloaded js, css and png, copied some code from the examples, wrote my own super-simple example, but I have to miss something. I checked that the .jquery.js code is included and loading, the same with the selected .css.
When I try to call even a very simple SELECT field (drop-down menu), I get a very small field, and clicking on the field does nothing. When I turn off selected.js, I just get a SELECT with all the options displayed.
Here, as I add a simple SELECT to jQuery (I have to populate the field dynamically, although in this example it is all hardcoded):
$html = '<select name="items" id="items" multiple="multiple" size="1" class="chosenElement">'; $html += '<option value="foo">foo</option>'; $html += '<option value="bar">bar</option>'; $html += '<option value="baz">baz</option>'; $html += '<option value="qux">qux</option>'; $html += '</select>';
Then, when I show the modal dialog box containing the parameters, I call:
$('.modal-body').html($html); $('.chosenElement').chosen();
So far I have modified and tested all kinds of permutations, Googled for solutions or examples, but nothing works. This is probably something very stupid, for example, a half-column missing somewhere, but I spent so much time on this “10-minute implementation” that I need to ask for help.
https://github.com/harvesthq/chosen