JQuery fullcalendar: contextmenu

I want to use jQuery.contextMenu:

http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin

In jQuery.fullcalendar , when I right click on an event, how does it work?

+4
source share
3 answers

I do not know the contextmenu plugin, but I think you can bind it to the eventRender fullcalendar event. I have a problem with dblClick on an event.

This is part of my solution:

 eventRender: function(event, element) { element.bind('dblclick', function() { dopbClickFunction(event,element); ....... 
+8
source

I solve exactly the same problem. For me, he performed the following two actions:

1 - code

 eventRender: function(calEvent,element){ element.bt({ ajaxPath: 'ajEvents.asp?opt=getExtendedEvent&valore=' + calEvent.id, trigger: 'hover', width: 200 }); //only for tooltip element.contextMenu('myMenu',{bindings:{'idVoce': function(t){ alert('right click on ' + calEvent.id) } } }) } 

I assume that you have already defined myMenu div ...

2 - change the zindex in the context menu, say, from 500 to 2500 and from 499 to 2499. This is important if you have a calendar in the dialog box (for example, myself), otherwise it will fall under the visible layer

+1
source

I used the Fullcalendar callback Loading: http://arshaw.com/fullcalendar/docs/event_data/loading/

 loading: function (bool, view) { if (bool){ jQuery('#com_jc_msg_saving').fadeIn(); } else { jQuery('#com_jc_msg_saving').fadeOut(); jQuery.contextMenu({ selector: '.fc-event',//note the selector this will apply context to all events trigger: 'right', callback: function(key, options) { //this is the element that was rightclicked console.log(options.$trigger.context); switch(key) { case 'edit_event': break; case 'del_event': break; case 'add_event': break; } }, items: { 'edit_event': {name: 'Edit'}, 'del_event': {name: 'Delete'}, 'add_event': {name: 'Create'}, } }); } }, 

The fact is that you will need to get the event identifier from this element - what I did was use the class name in json data events. Just replace a little line and you will have your identifier.

'className' => 'jc_event_'. $ Event-> identifier,

+1
source

All Articles