Hi,
I am having some issues with a dymanically created SchedulerContextMenu and ajax updates on a page. On the AppointmentContextMenu client side event, I fire off some javascript that attempts to enable/disable some option on the context menu based on attributes of the appointment. This was working fine when the context menu was defined statically on the page.
I have started to generate the menu dynamically as I wish to use it on other pages. This is how it is created:
It is assigned to the SiteScheduler in the PageLoad event on every load, see below:
The javascript that I am calling is this:
The above always returns null. Previously, i was using $find("%= SiteSchedulerContextMenu.ClientID %>") as this was defined in the markup
This fails after an ajax update and returns null. What am I doing wrong? Is there a different way to dynamically create and assign an appointment context menu to a scheduler?
Thanks,
I am having some issues with a dymanically created SchedulerContextMenu and ajax updates on a page. On the AppointmentContextMenu client side event, I fire off some javascript that attempts to enable/disable some option on the context menu based on attributes of the appointment. This was working fine when the context menu was defined statically on the page.
I have started to generate the menu dynamically as I wish to use it on other pages. This is how it is created:
public
static
RadSchedulerContextMenu BuildSiteAppointmentContextMenu(Page page)
{
RadSchedulerContextMenu cxt =
new
RadSchedulerContextMenu();
cxt.ID =
"SiteSchedulerContextMenu"
;
cxt.ClientIDMode = ClientIDMode.Static;
//QUICK ASSIGN
cxt.Items.Add(
new
RadMenuItem()
{
Text =
"Quick Assign"
,
Value =
"QuickAssignJob"
,
ImageUrl =
"~/Images/Menu/tiny/nav_right_blue_quick.png"
,
DisabledImageUrl =
"~/Images/Menu/tiny/nav_right_blue_quick_bw.png"
});
//ADVANCED ASSIGN
cxt.Items.Add(
new
RadMenuItem()
{
Text =
"Advanced Assign"
,
Value =
"AdvancedAssignJob"
,
ImageUrl =
"~/Images/Menu/tiny/nav_right_blue.png"
,
DisabledImageUrl =
"~/Images/Menu/tiny/nav_right_blue_bw.png"
});
//UNASSIGN
cxt.Items.Add(
new
RadMenuItem()
{
Text =
"Unassign Employee"
,
Value =
"UnassignJob"
,
ImageUrl =
"~/Images/Menu/tiny/nav_right_red.png"
,
DisabledImageUrl =
"~/Images/Menu/tiny/nav_right_red_bw.png"
});
return
cxt;
}
It is assigned to the SiteScheduler in the PageLoad event on every load, see below:
SiteSchedule.OverflowBehavior = OverflowBehavior.Expand;
SiteSchedule.ShowNavigationPane =
false
;
SiteSchedule.AppointmentContextMenus.Add(ContextMenu.BuildSiteAppointmentContextMenu(
this
.Page));
The javascript that I am calling is this:
function
GetSchedulerContextMenu() {
var
menu = document.getElementById(
"SiteSchedulerContextMenu"
);
return
menu;
}
This fails after an ajax update and returns null. What am I doing wrong? Is there a different way to dynamically create and assign an appointment context menu to a scheduler?
Thanks,