or
Good morning,
I need to dynamically change which elements in a RadComboBox drop down list are visible.
In the code below, the value selected in the first combo box (sender) is used to constrain the value in the second combo box (rcbAsgn) using some information stored in the tooltip for the item.
I tried the following:
function RCBProjects_OnClientSelectedIndexChanged(sender, eventArgs) {
var selPrjTUID = sender.get_value();
var rcbAsgn = $find("<%= RCBAssigned.ClientID %>");
var itms = rcbAsgn.get_items();
var i; var itm; var ttt;
rcbAsgn.trackChanges();
for (i = 0; i < itms.get_count(); i++) {
itm = itms.getItem(i);
ttt = itm._properties._owner._element.attributes[0].value;
var pos = ttt.lastIndexOf("-");
var tttid = ttt.substr(pos + 2, ttt.length - pos - 1);
if (tttid.valueOf() == selPrjTUID.valueOf()) itm.show();
else itm.hide();
}
rcbAsgn.commitChanges();
}
Everything seems to work fine except that, when complete, the second combo box no longer drops down. It is stuck on whatever value it had with no drop down capability at all - even though I have verified that, for example, two of four items have been shown with the other two hidden.
Any ideas?
Thanks.
Chris
<ClientSettings AllowRowsDragDrop=
"True"
>
<Selecting AllowRowSelect=
"True"
/>
<ClientEvents OnRowDropping=
"rowDropping"
/>
</ClientSettings>
function rowDropping(sender, eventArgs) {
// Fired when the user drops a grid row
var htmlElement = eventArgs.get_destinationHtmlElement();
var scheduler = $find(
'<%= RadScheduler1.ClientID %>');
scheduler.get_element().style.width = k.SchedulerPreferences.SchedulerWidth +
"px"
;
scheduler.repaint();
if (isPartOfSchedulerAppointmentArea(htmlElement)) {
// The row was dropped over the scheduler appointment area
// Find the exact time slot and save its unique index in the hidden field
var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
$get(
"TargetSlotHiddenField"
).value = timeSlot.get_index();
// The HTML needs to be set in order for the postback to execute normally
eventArgs.set_destinationHtmlElement(
"TargetSlotHiddenField"
);
}
else {
// The node was dropped elsewhere on the document
eventArgs.set_cancel(true);
}
refreshPage()
}