I have a Rad Scheduler control with a right-click context menu and a menu item to "edit appointment".
I want to direct the browser to another page altogether when the user clicks on that menu item. And I want to pass the appointment ID to the target page in the querystring.
Likewise, I want to pass the selected date if an "add appointment" menu item is clicked.
What's the best way to do this?
Thanks,
Jason
4 Answers, 1 is accepted
I have prepared sample demo that reproduces your scenario:
- Context menus for Insert/Update
- Response redirect to a different .aspx page where the Insert/Update takes place
In addition there is an online-demo that shows how RadSheduler can use RadContextMenu for editing/inserting appointments. You can find the demo here.
Best wishes,
Genady Sergeev
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
1.first in Radcontextmenu control add dis event....
OnClientItemClicking
="navigate"
2.next in radshedular add dis event.....
OnClientAppointmentContextMenu
="onclientappupdate"
function onclientappupdate(sender, eventArgs)
{
var apt = eventArgs.get_appointment();
var id = apt.get_id(); //for getting id
var subject = apt.get_subject(); //for getting subject
var SDate = apt.get_start(); //for getting start date
similarly for getting end date...
var EDate = apt.get_end();
document.getElementById(
'lblstartdate').value=dateString1;
lly all....
}
keep dis values in some hidden textboxes ...u get these values when u right click on the schedular...after that click on contextmenu item...in navigate function use these values...using hidden textboxes...
function navigate(sender, eventArgs)
{
var dateString1=document.getElementById('lblstartdate').value; //lly get all values
window.location.href("page1.aspx?startdate=" + dateString1);
}
I've just tried the demo you post pointed to. I don't know if this is expected behaviour, but I thought I'd mention it.
If you right-click on an existing event I get the context-menu I imagine you'd expect me to get. Likewise, if you click on an empty timeslot, you get a context-menu with various options for creating new appointments. However, if you do create a new appointment in an otherwise empty timeslot, right-clicking on the newly created appointment only produces the standard browser context menu.
--
Stuart
Thank you for reporting this issue with the online demo. There is a logical error with the implementation related to resources - the context menu relies on that the appointment will have a resource associated to it. Untill we fix the demo you can modify the code as follows:
| function checkResourceMenuItem(menu, appointment) |
| { |
| var calendar = appointment.get_resources().getResourcesByType("Calendar").getResource(0); |
| if (calendar) { |
| var categorizeItem = menu.findItemByText("Categorize"); |
| //Traverse all menu items below "Categorize" |
| for (var i = 0; i < categorizeItem.get_items().get_count(); i++) { |
| var item = categorizeItem.get_items().getItem(i); |
| if (item.get_value() == calendar.get_key()) { |
| //The item corresponds to the current "Calendar" - the Value of the item stores the Key of the resource |
| item.set_imageUrl("Images/checked.gif"); |
| } |
| else { |
| item.set_imageUrl(""); |
| } |
| } |
| } |
| } |
Best wishes,
Peter
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.