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

After upgrading DLL version from (5.8.1956.0) to (8.1.3460.1), Events are not working

Asked by Ashish
9 years ago.

We update dll of old version with latest version as given in subject,

Our Code is as following-

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" ViewType="Resources"
DataColumnField="column" DataEndField="end" DataStartField="Start" DataTextField="Name"
DataValueField="Id" HeightSpec="BusinessHoursNoScroll"
OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
BackColor="#FFFFFF" HourNameBackColor="#E1E7F5"
HourBorderColor="#C5CACE" HourHalfBorderColor="#F2F2F2" NonBusinessBackColor="#FFFFFF"
CellSelectColor="#C5CACE" DurationBarVisible="false" HourNameBorderColor="#ACBBCE"
BorderColor="#1E1F24" OnEventMove="DayPilotCalendar1_EventMove" EventMoveHandling="CallBack"
HourWidth="10" EventFontSize="7pt" ShowToolTip="False" TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="openPatientType(start, end, column);" OnBeforeCellRender="DayPilotCalendar1_BeforeCellRender"
BubbleID="DayPilotBubble1" AfterRenderJavaScript="afterRender(data);" HeaderLevels="2"
Style="top: 0px; left: 0px">
</DayPilot:DayPilotCalendar>

In this code , we are calling javascript function on event (TimeRangeSelectedJavaScript) and code is as folows-

TimeRangeSelectedJavaScript="openPatientType(start, end, column);

Now we are not able to get values of (start, end, column) parameters in javascript function but these values are getting properly when we don't change version. please let us know How we can resolve this issue asap.

Thanks In advance

Comment posted by Dan Letecky [DayPilot]
9 years ago.

The latest version (8.1) still supports this syntax. What kind of error do you see?

Comment posted by Ashish
9 years ago.

Actually, the event(TimeRangeSelectedJavaScript="openPatientType(start, end, column);) is called ,it is true but when javascript function(openPatientType(start, end, column)) calls we cannot get parameters value in javascript code and not works split() on any variable.Function is described as below-

function openPatientType(start,end,column)
{
var LunchDate = DayPilot.ds(start); //here cannot get value of LunchDate , alert shows undefined
var sepDate = LunchDate.split('T'); //and split() not working

//Checking Past Appointment Start

var splitDatePart = sepDate[0].split('-');
var splitTimePart = sepDate[1].split(':');
var monthPart = splitDatePart[1];
if(monthPart=="08")
{
var monthpart_1=8;
}
else if(monthPart=="09")
{
var monthpart_1=9;
}
else
{
var monthpart_1 =parseInt(monthPart);
}

monthpart_1= monthpart_1 - 1;
var clickedStartDate = new Date(splitDatePart[0],monthpart_1,splitDatePart[2],splitTimePart[0],splitTimePart[1],splitTimePart[2]);
var todayDate = new Date();
if(new Date(clickedStartDate) < new Date(todayDate)) {
if (!confirm("You have selected a past time or date. Do you wish to continue?")) {
return false;
}
// var conf_result = returnValue();
// if (conf_result == 7) {
// return false;
// }
hidSecurityOldAppt = document.getElementById("<%=hidSecurityOldAppt.ClientID%>");
var hdnPrefrence = document.getElementById("<%=hdnPrefrence.ClientID%>");
if (hidSecurityOldAppt.value != "1" )
{
todayDate.setDate(todayDate.getDate() - hdnPrefrence.value);
if (new Date(clickedStartDate) <= new Date(todayDate)) {
alert("Appointments cannot be created " + hdnPrefrence.value + " days or more in the past.");
return false;

}

}
}
//Checking Past Appointment End

//For Block OUt

var hdBlockOutValue = document.getElementById("<%=hdBlockOutValue.ClientID%>");

var hdAppAllowBlockOutOverride = document.getElementById("<%=hdAppAllowBlockOutOverride.ClientID%>");

var dayColumn = column.split("-");
var dayFitterId = dayColumn[1];
var dayOffice = dayColumn[0];
var i,j;

if(hdBlockOutValue.value.indexOf("$") > -1)
{
var strValues = hdBlockOutValue.value.split("$");
for(i = 0;i<strValues.length;i++)
{
if(strValues[i] != null && strValues[i] != '')
{
var strRowValue = strValues[i].split("^");
var strColumnField = strRowValue[0];
var strOfficeNum = '';
var strFitterId = '';
if(strColumnField.length > 0 && strColumnField != null)
{
var strColumnValues = strColumnField.split("-");
strOfficeNum = strColumnValues[0];
strFitterId = strColumnValues[1];
}
var vTemp = 0;
var vTemp1 = 0;
var strDateField = strRowValue[1].split("%");
var strStartDate = strDateField[0];
var strEndDate = strDateField[1];
var dayStartDate = DayPilot.ds(start).replace('T',' ').replace('-','/');
var dayEndDate = DayPilot.ds(end).replace('T',' ').replace('-','/');
if(strOfficeNum != '')
{
if(strOfficeNum == dayOffice)
{
vTemp = 1;
}
}
else
{
vTemp = 1;
}
if(strFitterId != "")
{
if(strFitterId == dayFitterId)
{
vTemp1 = 1;
}
}
else
{
vTemp1 = 1;
}

if(new Date(dayStartDate) >= new Date(strStartDate) && new Date(dayEndDate) <= new Date(strEndDate) && parseInt(vTemp) == 1 && parseInt(vTemp1) == 1)
{

if(hdAppAllowBlockOutOverride.value != "1")
{
makeAlert('Appointment','The selected time slot has been blocked out for this practitioner.\n Please choose a different practitioner or a different time.');
return false;
}
else
{
var answer = confirm ("The selected time slot has been blocked out for this practitioner. Do you wish to continue?”")
if (!answer)
{
return false;
}
}
}
}
}
}

Please let us know How we can resolve this issue .

Comment posted by Alok Sharma
9 years ago.

we are getting value in JavaScript 'undefined' if we use alert of start, end , column. please let us know how to resolve this .

Answer posted by Dan Letecky [DayPilot]
9 years ago.

In the latest version, "start" and "end" variables hold a DayPilot.Date object. You can get the the value as a string in ISO 8601 format by calling .toString():

var LunchDate = start.toString();

See also:
http://api.daypilot.org/daypilot-date-class/

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