Hi,
I am using following script for multi selection in radcombo
and javascript is as follows:
From above code I am able to select multiple values but the selected values are not appearing drop down as a semicolon separated string.
what I am missing in the code can any one help?
Thanks,
Ram.
I am using following script for multi selection in radcombo
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
EmptyMessage
=
"Select Countries"
AllowCustomText
=
"true"
MarkFirstMatch
=
"true"
HighlightTemplatedItems
=
"true"
Width
=
"150px"
OnClientDropDownClosed
=
"onDropDownClosing"
>
<
ItemTemplate
>
<
div
onclick
=
"StopPropagation(event)"
class
=
"combo-item-template"
>
<
asp:CheckBox
runat
=
"server"
ID
=
"chk1"
Text='<%# Eval("Country") %>' onclick="onToCheckBoxClick(this,'')"/>
</
div
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
function
onToCheckBoxClick(chk, temp) {
var
show = document.getElementById(temp);
var
combo = $find(
"<%= RadComboBox1.ClientID %>"
);
cancelDropDownClosing =
true
;
var
text =
""
;
var
values =
""
;
var
items = combo.get_items();
for
(
var
i = 0; i < items.get_count(); i++) {
var
item = items.getItem(i);
var
chk1 = $get(combo.get_id() +
"_i"
+ i +
"_chk1"
);
if
(chk1.checked) {
text += item.get_text() +
";"
;
values += item.get_value() +
";"
;
}
}
text = removeLastComma(text);
values = removeLastComma(values);
}
var
cancelDropDownClosing =
false
;
function
StopPropagation(e) {
e.cancelBubble =
true
;
if
(e.stopPropagation) {
e.stopPropagation();
}
}
function
onDropDownClosing() {
cancelDropDownClosing =
false
;
}
function
removeLastComma(str) {
return
str.replace(/;$/,
""
);
}
From above code I am able to select multiple values but the selected values are not appearing drop down as a semicolon separated string.
what I am missing in the code can any one help?
Thanks,
Ram.