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

Problem with DayPilotMonth1 timeRangeSelectedCallBack

Asked by João Silva
11 years ago.

Hi,

i am using a item menu

<DayPilot:MenuItem Text="Event Details" Action="JavaScript" JavaScript="OpenPopup(e);">

to open a new window with the event details. However in the new window after i edit the data and submit it to the DB i have a js function to close the window a try to refresh by Callback the DayPilotMonth1, but nothing happens, the new window does not close and there is now update on the grid. Here is the code:

function ReturnPage() {

if (!ispostback){
var start = window.document.getElementById('txtStart').value; //date comes like '20-07-2009'
var end = window.document.getElementById('txtEnd').value;
var data = encodeURIComponent(document.getElementById('txtName').value) + '&' + encodeURIComponent(document.getElementById('txtId').value);
window.opener.document.getElementById('ctl00_ContentPlaceHolder1_DayPilotMonth1').timeRangeSelectedCallBack(start, end, data);
self.close();
}
}

and here is the DayPilotMonth1:

<DayPilot:DayPilotMonth ID="DayPilotMonth1" runat="server" DataEndField="dtEnd" DataStartField="dtStart"
DataTextField="szName" DataValueField="lid" DataTagFields="szName,szDesc,szObs,szDataType"
ContextMenuID="DayPilotMenu1" OnEventMenuClick="DayPilotCalendar1_EventMenuClick"
ClientObjectName="dpm" OnEventMove="DayPilotMonth1_EventMove"
Width="100%" OnEventResize="DayPilotMonth1_EventResize"
OnTimeRangeSelected="DayPilotMonth1_TimeRangeSelected"
TimeRangeSelectedHandling="CallBack"
BubbleID="DayPilotBubble1"
ShowToolTip="false"
EventStartTime="false"
EventEndTime="false"
OnCommand="DayPilotMonth1_Command"
AfterRenderJavaScript="afterRender(data);"
CssClassPrefix="month_silver_" BackColor="White" HeaderBackColor="#7799AF"
NonBusinessBackColor="#E9EADC" EventStackingMode="Cell"
EventClickJavaScript="ShowObs(e);"
>
</DayPilot:DayPilotMonth>

Comment posted by Dan Letecky
11 years ago.

You should use this:

window.opener.dpm.timeRangeSelectedCallBack(start, end, data);

instead of this:

window.opener.document.getElementById('ctl00_ContentPlaceHolder1_DayPilotMonth1').timeRangeSelectedCallBack(start, end, data);

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