This is a migrated thread and some comments may be shown as answers.

[Solved] Click appointment context menu and navigate to another url with appointment ID in querystring

4 Answers 300 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 05 Apr 2009, 11:22 PM
Hi,

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

Sort by
0
Genady Sergeev
Telerik team
answered on 06 Apr 2009, 02:32 PM
Hello Jason,

I have prepared sample demo that reproduces your scenario:
  1. Context menus for Insert/Update
  2. Response redirect to a different .aspx page where the Insert/Update takes place
You can find it as an attachment.

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.
0
bhargava
Top achievements
Rank 1
answered on 08 Apr 2009, 07:32 AM
Hi Jason,     check dis it may help you....
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);

 

 

}

0
Stuart Hemming
Top achievements
Rank 2
answered on 09 Apr 2009, 09:01 PM
Genady,

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
0
Peter
Telerik team
answered on 10 Apr 2009, 10:20 AM
Hello 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.
Tags
Scheduler
Asked by
Jason
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
bhargava
Top achievements
Rank 1
Stuart Hemming
Top achievements
Rank 2
Peter
Telerik team
Share this question
or