Disable Double-Click Edit, Allow Context-Menu Edit

6 posts, 1 answers
  1. Rick
    Rick avatar
    33 posts
    Member since:
    Mar 2014

    Posted 23 Jan 2015 Link to this post

    We have a radScheduler and we want the users to right-click to bring-up a context menu in order to edit.  This allows us to present a set of choices specific to the day or the appointment they are editing.  It gives us greater control.

    We do not want them to be able to double-click the day or appointment.  We want double-clicking to do absolutely nothing.

    How can this be accomplished?
  2. Rick
    Rick avatar
    33 posts
    Member since:
    Mar 2014

    Posted 23 Jan 2015 in reply to Rick Link to this post

    To clarify:

    We want to disable DoubleClicking for Inserts.  
    We want to allow Inserts via the context menu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 28 Jan 2015 Link to this post

    Hi Rick,

    The context menu is enabled by default, so you just need to disable the time slot clicking. This can be done with jQuery:

    function pageLoad() {
        $('.rsContentTable td').click(function (e) {
            e.stopPropagation();
        }).dblclick(function (e) {
            e.stopPropagation();
        });
    }

    I hope this helps.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Rick
    Rick avatar
    33 posts
    Member since:
    Mar 2014

    Posted 28 Jan 2015 in reply to Hristo Valyavicharski Link to this post

    Thank you, that worked well for us.
  6. Erick Burgess
    Erick Burgess avatar
    12 posts
    Member since:
    Apr 2009

    Posted 07 Oct Link to this post

    I am having a problem with the stopPropagation solution above. This is disabling double click events on both the empty time slots as well as the appointments. I would like to disable ONLY the empty time slot double click event and keep the appointment double clicks.
  7. Anton
    Admin
    Anton avatar
    61 posts

    Posted 12 Oct Link to this post

    Hi Erick,

    You could use the OnClientAppointmentInserting event as in the following code:

    var $ = $telerik.$;
     
    function OnClientAppointmentInserting(sender, args) {
        var isContextMenuVisible = $('ul.rmActive.rmVertical.rmGroup.rmLevel1').is(":visible");
     
        if (!isContextMenuVisible) {
            args.set_cancel(true);
        }
    }

    Regards,
    Anton
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017