Hi
I'm having trouble implementing a RadComboBox. The thing I would like to do is to save a temporary state of which checkboxes that where checked when the dropdown list first was opened. The state should then be used to restore the checked checkboxes if the user click on a cancel button. To do this have I tried the following code.
The problem I'm experience is that when the page loads, the SaveState method is called. This is not what was intended. Even worse is that $find(DropDownID) is returning null and therefore breaks the whole function. The function is working as it should if I hook up it to a button that is called after the page has loaded. Any suggestions on what whats wrong and what to do?
I'm having trouble implementing a RadComboBox. The thing I would like to do is to save a temporary state of which checkboxes that where checked when the dropdown list first was opened. The state should then be used to restore the checked checkboxes if the user click on a cancel button. To do this have I tried the following code.
<
telerik:RadComboBox
ID
=
"RadComboBox1"
Runat
=
"server"
CheckBoxes
=
"true"
EnableCheckAllItemsCheckBox
=
"true"
Localization-CheckAllString
=
"Select all"
EmptyMessage
=
"Select"
AutoPostBack
=
"false"
LabelCssClass
=
"MultipleChoiceLabels"
DropDownCssClass
=
"MultipleChoiceLabels"
OnClientItemChecked
=
"SaveState('ucMCDFilterByIAI_RadComboBox1')"
>
</
telerik:RadComboBox
>
function SaveState(DropDownID) {
var combo = $find(DropDownID);
var state = new Array();
var items = combo.get_items();
var itemCount = items.get_count();
for (var counter = 0; counter < itemCount; counter++) {
var item = items.getItem(counter);
}
}
The problem I'm experience is that when the page loads, the SaveState method is called. This is not what was intended. Even worse is that $find(DropDownID) is returning null and therefore breaks the whole function. The function is working as it should if I hook up it to a button that is called after the page has loaded. Any suggestions on what whats wrong and what to do?