Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
What is the "proper" way to set/clear a WebDropDown checkbox
posted

I have a WebDropDown populated at the server, and would like to client-side set or clear the checkbox on a particular item

<ig:WebDropDown ID="MyDropDownControl" runat="server" DisplayMode="DropDownList" EnableMultipleSelection="True" MultipleSelectionType="Checkbox" />

 

var ctrl = $find('MyDropDownControl');

var item0 = ctrl.get_items().getItem(0);

 

// these next two statements do select/unselect

// but no effect to the checkbox

item0.select();

item0.unselect();

 

// this does set the checkbox, but seems rather dangerous

item0.get_element().childNodes[0].checked = true;

Thank you!

Parents
  • 24671
    posted

    Hi,

    Currently the checkbox state when checkbox-type multiple selection is used,  is not updated when you use select() / unselect(). The way to check and unckeck it is as you have currently specified (as a workaround only).

    I have submitted a request to fix this behavior so that it works out of the box.

    Hope it helps,

    Angel 

Reply Children