Hello,
Is there a way to replicate the ClearCheckedItems() method on the client side for a radcombobox.
I am able the uncheck all check box using javascript, but if after I hit a button and code to the server code, the Checkbox are still considered checked. Also, if I clear the checked items using the javascript and select other items after, the counter will display a wrong
number of selected items
Any Ideas?
Thanks.
Is there a way to replicate the ClearCheckedItems() method on the client side for a radcombobox.
I am able the uncheck all check box using javascript, but if after I hit a button and code to the server code, the Checkbox are still considered checked. Also, if I clear the checked items using the javascript and select other items after, the counter will display a wrong
number of selected items
function
radComboBoxLocationSelectedIndexChanged(item) {
resetRadComboboxWithCheckBox(
'<%=radComboBox1.ClientID %>'
);
}
function
resetRadComboboxWithCheckBox(comboBoxClientId) {
var
d = $find(comboBoxClientId);
d.set_text(
""
);
d.clearSelection();
var
items = d.get_items();
var
itemsCount = items.get_count();
for
(
var
itemIndex = 0; itemIndex < itemsCount; itemIndex++) {
var
item = items.getItem(itemIndex);
var
chk = getItemCheckBox(item);
if
(chk !=
null
) {
chk.checked =
false
;
}
}
}
function
getItemCheckBox(item) {
//Get the 'div' representing the current RadComboBox Item.
var
itemDiv = item.get_element();
//Get the collection of all 'input' elements in the 'div' (which are contained in the Item).
var
inputs = itemDiv.getElementsByTagName(
"input"
);
for
(
var
inputIndex = 0; inputIndex < inputs.length; inputIndex++) {
var
input = inputs[inputIndex];
//Check the type of the current 'input' element.
if
(input.type ==
"checkbox"
) {
return
input;
}
}
}
Any Ideas?
Thanks.