0

is it possible for the eventClick to happen on a right click?

I don't know of ways in which I can do this.

thanks for your help

luiscdz
  • 29
  • 1
  • 4
  • See this answer: http://stackoverflow.com/questions/1206203/how-to-distinguish-between-left-and-right-mouse-click-with-jquery – phayton Sep 28 '13 at 08:57

2 Answers2

3

this was my solution without modify the core code of fullcalendar.

eventRender method always execute for every events in the calendar, allowing adding an event maousedown where i can know when the right click have occur and i can control this event.

   $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        editable: true,
        selected:true,
        events: [

            {
                id: 1,
                title: 'Repeating Event',
                start: new Date(y, m, d-3, 16, 0),
                allDay: false
            },
            {
                id: 2,
                title: 'Repeating Event',
                start: new Date(y, m, d+4, 16, 0),
                allDay: false
            }
        ],
         eventRender: function(event, element, view)
              {               
                             var elemento = element;
                             var evento   = event;
                             var vista    = view;

                              console.log("eventRender");
                              console.log(event);                                 
                              console.log(element);
                              console.log(view);

                          element.on('mousedown',{elemento:elemento,evento:evento,vista:vista} , HelloWorld);
               },
        eventClick:function(){
            console.log("evento clickeado........");
        },
        dayClick:function () {
            console.log(" clickeado........");
        }
    });


function HelloWorld(event){  if(event.which == 3){console.log("event right click .....") }//event.which = 3 is right click

I'm sorry for my english.....

luiscdz
  • 29
  • 1
  • 4
0

This seems to be an extension that allow right click on events and days with two new callbacks:

dayRightclick(date, jsEvent, view)
eventRightclick(event, jsEvent, view)

Here is the demo : https://jsfiddle.net/a17kuyL0/

Max
  • 19
  • 5
  • This is an old one and **now broken** extension manager has [given up](https://github.com/mherrmann/fullcalendar-rightclick/issues/8) on it it seems. – Fawad Raza Aug 24 '20 at 10:42