My WebDropDown is bound to a dataset with multiple select checkbox. I added an extra item to the top of the list "All". Now when the user selects/clicks on the "All" option, all the available options in the WebDropDown should be checked. Can someone please guide or share the code that does this functionality? Thanks
Hi,
Not sure what your exact custom code is, but you can programatically (through JavaScript code) check or uncheck a checkbox by doing checkboxElement.checked=true; or checkboxElement.checked=false
where "checkboxElement" is the DOM element representing the checkbox.
About select() - which version of the controls are you using? I think there was some issue associated with this, but it was fixed a while ago.
Thank you,
Angel
Related to above , how I can check whether the 'ALL' item's checkbox is checked or unchecked ?
And item.select() only select's all the values, and does not shows the checkboxes as a checked for all.
Its very urgent , even I have open a support request for this.
Yes sure,
so in the selectedIndexChanged event, you will need to do the following:
1) get the item that's being selected (if that's the first item, the array of selected items will only contain 1 item)
2) if the item is the first one, i.e. if item.get_index() == 0, then:
3) add the following code:
for (i=1; i<sender.get_items().getLength(); i++)
{
var item = sender.get_items().getItem(i);
item.select();
}
This will select all of your items below the first one. Same for unselecting them, instead of .select(), call unselect().
Hope it helps,