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

How to implement to delete appointment when 'del' key is pressed

5 Answers 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zhu
Top achievements
Rank 1
Zhu asked on 14 Mar 2013, 08:48 AM
How to implement to delete an appointment when 'del' key is pressed from keyboard. From the radScheduler demo i can delete the appointment by press 'Del' key from keyboard. But I do not know how to easily enable this fuction for radScheduler (asp.net) control? Can you give me a simple example? thanks.

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 15 Mar 2013, 07:06 AM
Hi,

 
Would you please share which demo are you having in mind so we could be more helpful?

Greetings,
Plamen
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
Zhu
Top achievements
Rank 1
answered on 15 Mar 2013, 07:23 AM
From this demo link about keyborad support http://demos.telerik.com/aspnet-ajax/scheduler/examples/keyboardsupport/defaultcs.aspx  i hope to delete the selected appointment by press Delete key from keyboard. How to implement it? 
0
Zhu
Top achievements
Rank 1
answered on 15 Mar 2013, 07:30 AM
Please refer to the screen shot.
0
Zhu
Top achievements
Rank 1
answered on 19 Mar 2013, 07:20 AM
hi, can you help with this question? i have add detailed screen shot and hope to implement to delete appointment by press 'Delete' from keyboard. thanks.
0
Plamen
Telerik team
answered on 19 Mar 2013, 11:26 AM
Hello,

 
Radscheduler does to support such behavior by default but it can easily be achieved with jQuery as in the code below:

function pageLoad() {
              var $ = $telerik.$;
              $('html').keydown(function (e) {
                  if (e.keyCode == 46) {
                      var scheduler = $find('<%=RadScheduler1.ClientID %>');
                      
                      var selectedAppointmentdomElement = $(".rsAptSelected");
                      if (selectedAppointmentdomElement.length>0) {
                          var appointment = scheduler.getAppointmentFromDomElement(selectedAppointmentdomElement[0]);
                          scheduler.deleteAppointment(appointment);
                      }
                  }
              })
          }

You can also use deleteAppointmentWithConfirmation function as described in this help article.

Hope this will be helpful.

Greetings,
Plamen
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.
Tags
Scheduler
Asked by
Zhu
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Zhu
Top achievements
Rank 1
Share this question
or