Just above my RAD Scheduler, I've placed a hyperlink that says "Add a New Appointment". If double-clicking the RAD Scheduler cell to add a new Appointment isn't intuitive enough for the average User, then the User should know enough to click this link.
I currently have the click event of this link wired up to the JavaScript AppointmentInserting event. When this event is invoked by double-clicking the RAD Scheduler date cell to add a new Event, I have access to the passed in (sender, eventArgs) values. Several values are set, our custom Advanced Edit form opens with a modal underlay, and everything works as expected.
Going back to the new hyperlink I've added, I would like the click event of the link to replicate the same functionality as above. However, I do not have access to the (sender, eventArgs) values. Ideally, I would like to trick the event handler into thinking that the event was fired from the RAD Scheduler. Because I do not have access to the (sender, eventArgs) values, the JS event does not function as expected. The Advances Edit form opens with a modal underlay, but it is soon blown away because I wasn't able to successfully call eventArgs.setCancel(true).
Is this functionality possible? For your reference, I've posted my code below.
Thanks!
Mike
------------------------------------------------------------------------------------------------------------------
I currently have the click event of this link wired up to the JavaScript AppointmentInserting event. When this event is invoked by double-clicking the RAD Scheduler date cell to add a new Event, I have access to the passed in (sender, eventArgs) values. Several values are set, our custom Advanced Edit form opens with a modal underlay, and everything works as expected.
Going back to the new hyperlink I've added, I would like the click event of the link to replicate the same functionality as above. However, I do not have access to the (sender, eventArgs) values. Ideally, I would like to trick the event handler into thinking that the event was fired from the RAD Scheduler. Because I do not have access to the (sender, eventArgs) values, the JS event does not function as expected. The Advances Edit form opens with a modal underlay, but it is soon blown away because I wasn't able to successfully call eventArgs.setCancel(true).
Is this functionality possible? For your reference, I've posted my code below.
Thanks!
Mike
------------------------------------------------------------------------------------------------------------------
| <div> | |
| <asp:LinkButton ID="lbAddNewSchedulerEvent" OnClientClick="javascript:AppointmentInserting();" runat="server">Add New Scheduler Event</asp:LinkButton> | |
| </div> | |
| <div> | |
| <telerik:RadScheduler | |
| ........ | |
| </telerik:RadScheduler> | |
| </ | |
| div> | |
| function AppointmentInserting(sender, eventArgs) | |
| { | |
| try | |
| { | |
| var start = formatDate(eventArgs.get_startTime()); | |
| } | |
| catch (e) | |
| { | |
| var start = "01/01/2009"; | |
| } | |
| try | |
| { | |
| var isAllDay = eventArgs.get_isAllDay(); | |
| } | |
| catch (e) | |
| { | |
| var isAllDay = true; | |
| } | |
| //New appointment | |
| window.radopen( | |
| "DefaultTemplates/AdvancedForm.aspx?Mode=Insert&Start=" + start + "&IsAllDay=" + isAllDay, "AdvancedForm"); | |
| try | |
| { | |
| eventArgs.set_cancel( | |
| true); | |
| } | |
| catch (e) | |
| { | |
| alert( | |
| "I need to make sure the Advanced Edit form doesn't close here...How can I invoke a Cancel??"); | |
| alert(e); | |
| } | |
| } | |