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 » Bugs » EventClickJavaScript Not popping up box.

EventClickJavaScript Not popping up box.

Hi Dan,

I am on version 3.7 and having difficulty with a postback occuring when an event is clicked. I believe this postback is interferring with my popup window displaying.

I have the TimeRangeSelectedJavaScript implementing the same popup javascript function as the EventClickJavaScript function and it work perfectly without a postback. This is why I assume the postback is interferring.

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" DataColumnField="Resource_Name"
DataEndField="ET" DataStartField="BT" DataTextField="Event" DataValueField="Resource_Name"
ViewType="Resources" Style="left: 3px; top: -42px" TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="openPopup(start,end,column);"
BusinessBeginsHour="7"
BusinessEndsHour="21" OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
EventDeleteHandling="CallBack" OnEventDelete="DayPilotCalendar1_EventDelete"
HourFontSize="14pt" HeightSpec="BusinessHoursNoScroll" EventClickHandling="JavaScript"
EventClickJavaScript="openPopup(start,end,column);" EventEditHandling="JavaScript"
EventEditJavaScript="openPopup(start,end,column);">
</DayPilot:DayPilotCalendar>

Hope this helps

Donahue - 1/11/2008 11:51:53 PM
I've tested the 3.7 demo (I switched to EventClickHandling="JavaScript") and it executed the JavaScript properly. It should never fire PostBack unless you call it in your JavaScript handler.

Just note that start, end, and column variables are not available for the event click handler. You should use the e variable (class DayPilotCalendar.Event).

Are you sure that you don't change EventClickHandling somewhere in the code behind?
Dan Letecky - 1/20/2008 5:07:51 PM

Hi Dan,

I did have the Event and Edit handlers set to CallBack in my codebehind. I changed this and started using the e.start, e.end and e.columnId in the Event and Edit as you stated. I am now receiving, in the return of the start variable,

"function() { return new Date(object.getAttribute(\"dpStart\")); }"

which I expect the start information, like a time or something. What am I doing wrong to receive the string above from a click on the event?

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" DataColumnField="Resource_Name"
DataEndField="ET" DataStartField="BT" DataTextField="Event" DataValueField="Resource_Name"
ViewType="Resources" Style="left: 3px; top: -42px" TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="openPopup(start,end,column);"
BusinessBeginsHour="7"
BusinessEndsHour="21" OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
EventDeleteHandling="CallBack" OnEventDelete="DayPilotCalendar1_EventDelete"
HourFontSize="14pt" HeightSpec="BusinessHoursNoScroll" EventClickHandling="JavaScript"
EventClickJavaScript="openPopup(e.start,e.end,e.columnId);" EventEditHandling="JavaScript"
EventEditJavaScript="openPopup(start,end,column);">
</DayPilot:DayPilotCalendar>

function openPopup(start, end, column) {
window.open('Reservation.aspx?start=' + start + '&end=' + end + '&column=' + column ,'PopupDetail','width=535,Height=360,top=200,left=100' );
}

Donahue - 1/26/2008 6:33:48 PM
You should use this instead:

openPopup(e.start(),e.end(),e.columnId());
Dan Letecky - 2/3/2008 5:29:03 PM
Post reply