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

EventClickJavaScript Not popping up box.

Asked by Donahue
16 years ago.

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

Comment posted by Dan Letecky
16 years ago.
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?
Comment posted by Donahue
16 years ago.

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' );
}

Comment posted by Dan Letecky
16 years ago.
You should use this instead:

openPopup(e.start(),e.end(),e.columnId());
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.