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

How to Hide Add New Appointment TimeSlotContextMenus

5 Answers 56 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Madhan
Top achievements
Rank 1
Madhan asked on 17 Mar 2012, 12:05 PM
Hi All,
 when we right click on scheduler Past time slot i want to hide my 'Add New Appointment' TimeSlotContextMenu. I don't want to allow to add Appointments for past date and time.

Thanks
Madhan

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Mar 2012, 08:00 AM
Hi Madhan,

 
You can handle the onClientTimeSlotContextMenu event of RadScheduler as in the javascript code bellow:

function OnClientTimeSlotContextMenu(sender, args) {
            var newAppItem = sender.get_timeSlotContextMenus()[0].get_items().getItem(0);
            var currentTime = new Date()
            if (args.get_time() < currentTime) {
                $telerik.$(newAppItem.get_element()).hide();
            }
            else {
                $telerik.$(newAppItem.get_element()).show();
            }
        }

Hope this will be helpful.

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Madhan
Top achievements
Rank 1
answered on 22 Mar 2012, 08:24 AM

Hi Plamen Zdravkov,

Thanks for your reply,  its helps me lot... :)

Thanks,
Madhan
0
Madhan
Top achievements
Rank 1
answered on 22 Mar 2012, 08:52 AM
Hi Plamen Zdravkov,

I am facing one more issue related this, also i don't want to show my "Add Appointment" popup template when i double click on past datetime. How can i hide my "Add Appointment"  popup window if i double click on past date.


Thanks,
Madhan
0
Plamen
Telerik team
answered on 23 Mar 2012, 12:23 PM
Hi Madhan,

 
You can check the time in the onClientAppointmentInserting event as in the code:

function OnClientAppointmentInserting(sender, args) {
     
         var currentTime = new Date()
            if (args.get_startTime() < currentTime) {
               args.set_cancel(true);
            }
}

Hope this will help.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Madhan
Top achievements
Rank 1
answered on 23 Mar 2012, 01:26 PM
Hi Plamen Zdravkov, 

Thanks a lot, its working perfectly ....:)

Thanks,
Madhan

Tags
Scheduler
Asked by
Madhan
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Madhan
Top achievements
Rank 1
Share this question
or