Closed GoogleCodeExporter closed 8 years ago
I am using the forceMultiple option because I don't want a tall multiple select
box to change the page layout until the DDCL is being rendered. Is this the
point of the forceMultiple option? I can style the select box to be one line
tall, but that makes it very hard to use with js disabled.
Original comment by garland....@gmail.com
on 24 Mar 2011 at 6:49
Here is my workaround for now.
<select name="fruit" id="fruit">
<option></option>
<option value="Apple">Apple</option>
<option value="Banana">Banana</option>
<option value="Orange">Orange</option>
</select>
$("#fruit").attr('multiple', true);
$("#fruit option:first-child").remove();
$("#fruit").dropdownchecklist();
Instead of using forceMultiple, I add the MULTIPLE attribute, remove the first
option (the blank one), and then call DDCL. That happens quickly enough that
visually you go straight from an empty select element to the empty DDCL.
Original comment by garland....@gmail.com
on 24 Mar 2011 at 7:28
The final issue I encountered with my workaround is that I could not initialize
multiple options in the select element to be selected (since it's not created
as a multiple select). To solve this, I added code to set the initial values
just before calling DDCL.
$("#fruit").attr('multiple', true);
$("#fruit option:first-child").remove();
$("#fruit").val(["Apple","Orange"]);
$("#fruit").dropdownchecklist();
Original comment by garland....@gmail.com
on 24 Mar 2011 at 8:40
I will add this to the wish-list and see if I can come up with something in a
future release.
Original comment by womohun...@ittrium.com
on 8 Apr 2011 at 5:45
OOPS - forgot to change issue status to Accepted
Original comment by womohun...@ittrium.com
on 8 Apr 2011 at 5:46
With version 1.4, an empty <Option> can be included as the first element (which
then gets the auto-default selection) No checkbox is created for the empty
option.
Original comment by womohun...@ittrium.com
on 14 Jun 2011 at 9:20
Original issue reported on code.google.com by
garland....@gmail.com
on 24 Mar 2011 at 6:40