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

How to prevent event dragging and resizing

Asked by Hoang Phung
10 years ago.

I need to lock down (i.e. prevent moving and resizing) an event that has certain attributes. I was able to do that calling args.preventDefault() in onEventMove() and onEventResize(). However, the user is still able to drag and resize the event and only has the operation cancelled afterwards.

My question is whether it is possible to prevent the dragging from even being started? I have tried setting 'moveDisabled' property on Event but it didn't work. Thanks.

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

You should set the .moveEnabled property on the DayPilot.Event.data object, not on DayPilot.Event directly:

var e = new DayPilot.Event({
  start: "2014-03-25T00:00:00"),
  end: "2014-03-25T12:00:00",
  id: 123,
  resource: "B",
  text: "Event",
  moveDisabled: true
});

See also:
http://api.daypilot.org/daypilot-event-data/

Comment posted by Patrick
10 years ago.

Is there a typo on the line that sets the start date?

Comment posted by Patrick
10 years ago.

Also, setting the moveDisabled property to false on the data object still allows it Event to be movable...

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