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

Confirmation prompt of event resize or event move

Asked by Anonymous
1 month ago.

can you provide me with a functional sample of the javascript confirmation modal to ask for confirmation before moving or resizing an event? is the clientobjectname the same as the ID of the control?

Answer posted by Dan Letecky [DayPilot]
1 month ago.

You can find an example in the documentation, Event Moving page (expand the ASP.NET WebForms section to see it):

<DayPilot:DayPilotScheduler runat="server" id="DayPilotScheduler1"
  ...
  
  ClientObjectName="dps"
  EventMoveHandling = "JavaScript"
  EventMoveJavaScript="if (confirm('Do you really want to move this event?')) { dps.eventMoveCallBack(e, newStart, newEnd, newResource); } "
  OnEventMove="DayPilotScheduler1_EventMove" 
/>

The default client object name is derived from the control ID. In most cases, it is the control ID but if you use a complex layout, it may include parent IDs. That’s why it is recommended to specify it explicitly using the ClientObjectName property.

Comment posted by Anonymous
1 month ago.

thank you for your response, i have tried this and the code will not build if i make this change. The control’s ID is not recognized anymore, should i replace it with the clientobjactname in the code?

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Yes, if you specify ClientObjectName you need to use this identifier in the JavaScript code.

Comment posted by Anonymous
1 month ago.

can you provide with a full sample? how would you change the code behind? i tried this and it’s not working

Comment posted by Dan Letecky [DayPilot]
1 month ago.

The configuration printed above is all that is required.

No changes are required on the server side. The eventMoveCallBack() method invokes the server-side EventMove event.

Comment posted by Anonymous
1 month ago.

thank you i managed to get it to work following your suggestion

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