Context Menu with Left-Click

7 posts, 1 answers
  1. Michael Malone
    Michael Malone avatar
    68 posts
    Member since:
    May 2010

    Posted 20 Oct 2010 Link to this post

    Is it possible to expose the context menu when the user performs a single left-click on a time-slot? 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Oct 2010 Link to this post

    Hello Michael,


    The following code can help you in showing the contextmenu when left-clicking the time-slot.

    Client code:
    function OnClientTimeSlotClick(sender, args) {
        sender.get_timeSlotContextMenus()[0].show(args.get_domEvent());
    }
    Attach the OnClientTimeSlotClick to RadScheduler.



    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael Malone
    Michael Malone avatar
    68 posts
    Member since:
    May 2010

    Posted 21 Oct 2010 Link to this post

    This does cause the context menu to appear on a left single-click but it's also generating an javascript error of "Error: 'undefined' is null or not an object". I've attached a screenshot.
  5. Michael Malone
    Michael Malone avatar
    68 posts
    Member since:
    May 2010

    Posted 21 Oct 2010 Link to this post

    And here is the JavaScript debugging window from IE.
  6. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 25 Oct 2010 Link to this post

    Hi Michael Malone,

    The reason for that error is that new Appointment cannot be created because the timeslot in which the context menu shows cannot be found. We need to edit the code  and use _showTimeSlotContextMenu private method:

    function OnClientTimeSlotClick(sender, args) {
                sender._showTimeSlotContextMenu(args.get_domEvent(), args.get_targetSlot());
            }

    Best wishes,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Steve Rothschild
    Steve Rothschild avatar
    6 posts
    Member since:
    Apr 2010

    Posted 12 Nov 2010 Link to this post

    How does this solution with work for an existing appointment?  We want to left click instead of right click to display the menu for an appointment?
  8. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 18 Nov 2010 Link to this post

    Hi Steve Rothschild,

    Please accept my apologies for the late reply.

    When you have an appointment and you need to display context menu by left-clicking on it you need to subscribe to the OnClientAppointmentClick event and use the following code in the handler:
     
    function OnClientAppointmentClick(sender, args) {
               sender._contextMenuAppointment = args.get_appointment();
               args.get_appointment().showContextMenu(args.get_domEvent());
    }

    Hope this helps.

    Best wishes,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017