Scheduler dayClick Right-Click (FullCalendar v3.9.0)
See original GitHub issueHi,
I first looked for topics related to this possibility but the answers always concern the right-click on the events (No problem with that). I’m looking for a way to call right-click on empty slots in “timelineDay” view
The goal is to generate a context menu to copy/cut an event and then paste it to another date on a free slot.
I modified the source code but it is really not ideal. Line 13682 of fullcalendar.js
component.bindDateHandlerToEl(el, 'contextmenu', function (ev) { if (!component.shouldIgnoreMouse() && ev.which == 3) { return dragListener.startInteraction(ev); } ev.preventDefault(); });
Then at initialization, I can do:
dayClick: function(date, jsEvent, view, resourceObj) { if(jsEvent.which == 3) { console.log('Right-Click ' + resourceObj.id + ' on date ' + date.format('YYYY-MM-DD HH:mm')); } }
Sometimes I get js errors (maybe related to drag functions) and it breaks all the functions.
Is there a simple way to capture the right-click on dayClick?
I specify that https://github.com/mherrmann/fullcalendar-rightclick is not usable with scheduler on the view “timelineDay”. I ran a lot of posts on StackOverflow and here but with no success for several days.
Thank you in advance for your help which I think will serve a lot of people.
I have no jsfiddle for the time because the function is not implemented. I’m just looking for advices et I apologize if I made mistake by submitting this. This is my first post on Github 😉
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top GitHub Comments
dayClick only supports left clicking currently, so there’s no easy way to tell which time slot was right-clicked on but that could be a useful feature. There’s a related issue to add this for agendaView: https://github.com/fullcalendar/fullcalendar/issues/2748
Aside from modifying the source, you could also listen for
contextmenu
on the entire calendar, then calculate which resource/time was clicked based on the position of the click.i’ve repurposed this existing ticket to be about right-click on date cells in the general sense: https://github.com/fullcalendar/fullcalendar/issues/2748 ↑ Could you please visit the link, give a 👍 to vote (?), press the 🔈Subscribe button to receive updates?