DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » How To » Conditionally appearing MessageBox(JavaScript)

Conditionally appearing MessageBox(JavaScript)

hi,

I want toshow a MessageBox in my EventMove. My problem is, that the MessageBox should not appear every time an Event moved. It only should shown bye some conditions. So I have to set the JavaScript only when the conditions are met. Any idea how i can handle this?

Thank you,

Torben K.

Anonymous - 1/31/2008 12:25:24 PM
There can be only a single JavaScript handler of move event. That means you can't set different handlers for different events.

There are two options:
  1. Check the condition on the client side in the in the JavaScript handler. You can pass the necessary parameters in Tags field.
  2. Check the condition on the server side. You can evaluate the condition and send the result back using Update("your string"). Assign AfterRenderJavaScript handler and check the value of data parameter (it will contain the string you passed to Update()). Then show the dialog if necessary. See also (F) Sending custom data back to the client after a CallBack (DayPilotCalendar & DayPilotScheduler) in DayPilot Pro 4.1 release notes for more details.
Dan Letecky - 2/6/2008 1:51:18 PM

Thank you again

Torben K. - 2/6/2008 3:52:43 PM
Post reply