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

Read only

Asked by Anonymous
4 years ago.

Dear all

i am using session variable to define access planning (read Only or full access)
if (mesDroits <= "1"){
		dp.eventClickHandling = "Disabled";
		dp.eventMoveHandling = "Disabled";
		dp.eventResizeHandling = "Disabled";
	        dp.allowDefaultContextMenu = false;
		  }

2 questions :

dp.allowDefaultContextMenu = false; doesn't work .
How Disabled add and delete Event ?

Thanks a lot.

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

The "allowDefaultContextMenu" property lets you enable the default browser context menu. By default, this is disabled for the Scheduler so that you don't see the browser context menu over the Scheduler context menu on right click. Normally, you don't want to display the browser context menu at all.

You can disable the event context menu using "eventRightClickHandling" property:

dp.eventRightClickHandling = "Disabled";

The default value is "ContextMenu".

See also:
https://api.daypilot.org/daypilot-scheduler-eventrightclickhandling/

For a full list of properties that will let you make the Scheduler read-only please see the following tutorial:
https://code.daypilot.org/65945/javascript-scheduler-read-only-mode

Comment posted by Anonymous
4 years ago.

Thanks .

it's working

if (mesDroits <= "1"){
		dp.timeRangeSelectedHandling = "Disabled";
		dp.eventClickHandling = "Disabled";
		dp.eventMoveHandling = "Disabled";
		dp.eventResizeHandling = "Disabled";
		dp.eventDeleteHandling = "Disabled";
		dp.eventRightClickHandling = "Disabled";
		  }

Comment posted by Anonymous
4 years ago.

Sorry,

dp.eventDeleteHandling = "Disabled";

doesn't work. I am using room hotel exemple with delete button. may be it s different ?

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

The hotel project includes the following line:

dp.eventDeleteHandling = "Update";

You need to make sure that your changes of the "eventDeleteHandling" property are executed later in order to override this value.

Comment posted by Anonymous
4 years ago.

You re right.

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.