RajeshChaudhary345 / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
0 stars 0 forks source link

Selecting and deselecting single items (request for info) #167

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Could you please describe clearly how (de)selecting items is done ?
I have tried by doing this to no avail :

$('#ddcl option').each(function() {
  $(this).attr('selected',false);
}

This doesn't change the visual status of the checkboxes.
When I try by doing :

$('#ra_ddcl'+i).attr('selected',false);

This doesn't give me a better result...
Is there any example available ?
Do I have to do a refresh or something ?

Many thanks

Original issue reported on code.google.com by jeanrig...@gmail.com on 21 Mar 2011 at 4:40

GoogleCodeExporter commented 8 years ago
DDCL is driven strictly by the state of the <SELECT> and <OPTION> items in the 
underlying html when the control is initialized.
Thereafter, it is the interactive end-user actions that change the status of 
the checkboxes.
If you want to change the selection state programmatically, you need to adjust 
the attributes on the <OPTION> fields within the html. You can then issue a 
'refresh' on the DDCL control to have it rescan the original html and adjust 
the state of the checkboxes accordingly.
The DEMO page has full documentation about this feature.  See the section 
called "Changing the original select element content or selection"

Original comment by womohun...@ittrium.com on 21 Mar 2011 at 5:40