Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Custom context menu in Calendar

    Hello,

    i am trying to add a context menu so that, when a calendar item is clicked, the regular editor pops up. However, if you right click on the calendar item, you should get a context menu with, for example, "Delete".

    I have managed to make that happen, but i have a hard time getting at the actual record. The only method in the MenuItemClickEvent that looks useful is getTarget(), but that's a canvas.

    Is there any way to get at the item like you can in CalendarEventClick for example (getEvent())?

    #2
    1. I am talking about a timeline, not Calendar

    2. What i am after is getting at the CalendarEvent in the Timeline which was rightclieked to show the contextmenu.
    It would make sense for that item to be part of the ShowContextMenuEvent, but the "firingCanvas" is the entire Timeline, not the CalendarEvent that was clicked on, which is strange to me.

    The event has an x and y, but from what i can see there's no way to get a CalendarEvent with x and y in the timeline. If i could, i could then store the event away and use it in the MenuItemClickEvents.

    I also tried using the EventClickHandler directly, but i couldn't get it to be called when right clicked. If i don't have an ContextMenu, the native context menu is displayed.


    I hope you see what im trying to do.
    Last edited by mathias; 19 Nov 2017, 23:03.

    Comment


      #3
      HI there,

      would be great if someone had the time to look at this:

      To summarize:
      When rightclicking on an event in the timeline, i need the event to build an event-context aware menu, for example "delete event". I can't seem to find it in the ShowContextMenuEvent, the "firingCanvas" is the entire Timeline, not the event i right clicked on.
      Last edited by mathias; 5 Dec 2017, 00:45.

      Comment


        #4
        Hi,
        Not exactly what you are looking for but close: getEventCanvasMenuItems(EventCanvas canvas)
        As I understand you can create roll-over menu button (instead of right click).
        MichalG

        Comment

        Working...
        X