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

6 posts, 0 answers
  1. Zhu
    Zhu avatar
    9 posts
    Member since:
    Jan 2013

    Posted 14 Mar 2013 Link to this post

    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.
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 15 Mar 2013 Link to this post

    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.
  3. Zhu
    Zhu avatar
    9 posts
    Member since:
    Jan 2013

    Posted 15 Mar 2013 Link to this post

    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? 
  4. Zhu
    Zhu avatar
    9 posts
    Member since:
    Jan 2013

    Posted 15 Mar 2013 Link to this post

    Please refer to the screen shot.
  5. Zhu
    Zhu avatar
    9 posts
    Member since:
    Jan 2013

    Posted 19 Mar 2013 Link to this post

    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.
  6. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 19 Mar 2013 Link to this post

    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.
Back to Top