Using dhtmlxMenu as a ContextMenu with Schedule - Section ID

I am using the dhtmlxMenu object with the Scheduler and have set it to renderAsContextMenu.

I am using the Timeline view and have rendered it as a ‘tree’.

I am able to show the context menu and when I right mouse click inside the Scheduler I can retrieve the eventid of the underlying event or null if I click on an empty cell. However I cannot retrieve the section id value of tree node when I RMC on any of the tree sections.

Is there a way of getting the sectionid of a node in the tree? :question:

The folder_events_available attribute is set to true.



I have been trying several things to get this to work but I am still not able to get the contextmenu to work on the tree sections of the new Scheduler.

Stanislav do you have any ideas how I could overcome this problem :question:

Hi Stanislav

Since I have not recieved any replies to this query am I right in saying that it is not possible to show a contextmenu for the sections on the y axis when used as a tree.

As I have used contextmenus with a standard tree object previously it obviously can be done, will you be extending this for use in the Scheduler and if so will this option be available soon?



Hello, Martin.

I am sorry for the late answer.
You can try the following:

scheduler.attachEvent("onContextMenu", function (event_id, native_event_object){ if(scheduler._locate_cell_timeline(native_event_object)) { var section = scheduler.matrix.timeline.y_unit[scheduler._locate_cell_timeline(native_event_object).y]; var section_id = section.key; } ... }
where scheduler.matrix.timeline.y_unit is the name of your timeline view.

Best regards,

1 Like

This worked perfect for me, also 10 years later :slight_smile: