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

Get current cell in Context Menu

Asked by Davide
7 years ago.

is it possible to get the start-end of current cell (not of the entire event) in eventMenuClickCallBack via Javascript?


<DayPilot:MenuItem Text="Split event" Action="JavaScript" JavaScript="dp.eventMenuClickCallBack(e,e.value());">

The event starts at 7:00 AM and ends at 7:00 PM.

I would like split it into 2 different events (7:00 AM - 10:00 AM and 11:00 AM - 7:00 PM) in VB but I need to know WHERE the user clicked on the menu. In my example, the user clicked on cell 10:00 AM - 11:00 AM.

So I've to pass the clicked cell through eventMenuClickCallBack as command parameter.


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

There is an internal JavaScript API that you can use (assuming ClientObjectName="dp"):

Current mouse cursor position as date/time (DayPilot.Date object):
var date = dp.getDate(dp.coords.x, true);
Start of the current cell:
var date = dp.getDate(dp.coords.x);

Comment posted by Anonymous
7 years ago.

Fantastic! Very usefull.

Thanks a lot!

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