search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Right click from mobile

Asked by Thomas
8 years ago.

I have a DayPilot scheduler which shows a ContextMenu on right click:

dp.contextMenu = new DayPilot.Menu({
items: [
{ text: "test1", onclick: function () { alert("Event value: " + this.source.value()); } },
{ text: "test2", onclick: function () { alert("Event text: " + this.source.text()); } } ]

Is there a way to show this context menu from a touchdevice with no physical "right-click"?

Answer posted by Dan Letecky [DayPilot]
8 years ago.

With the upcoming 7.8 release you will be able to use:

dp.eventTapAndHoldHandling = "ContextMenu";

This will activate the context menu for the "tap and hold" gesture. You will need to add custom drag handlers using event active areas to enable drag and drop event moving.

See also:

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Another option is to add an active area that will activate the context menu on "tap":

dp.onBeforeEventRender = function(args) {
  args.e.areas = [{"action":"ContextMenu","v":"Visible","w":17,"menu":dp.contextMenu,"css":"event_action_menu","h":17,"top":6,"right":19}];
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.