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

how to show contextMenu when right-click on timeRange

Asked by RajeshBoora
7 years ago.

I'm working with the Day pilot Pro JavaScript - Event calendar - v1531.

I'm trying to display a contextMenu when user right-clicked on the empty cell (time range). I have gone through the below documentation links but it doesn't explain how to achieve this in event calendar control.

I have tried something with the timeRangeSelectedHandling: "Hold"/"JavaScript". I'm bit struck with how to create/attach the context menu to timeRangeRightClick.
Please find the fiddle here:

Please help me to resolve this.

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

You need to specify the context menu using .contextMenuSelection:

    dpc.contextMenuSelection = new DayPilot.Menu([
        {text: "New appointment", onclick: function (args) { 
            var start = this.source.start;
            var end = this.source.end;
            var resource = this.source.resource;
            var e = new DayPilot.Event({start: start, end: end, resource: resource, id: DayPilot.guid(), text: "New event"});

See also the updated jsfiddle:

Comment posted by RajeshBoora
7 years ago.


This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.