This is a migrated thread and some comments may be shown as answers.

Client-side appointment Start and End time problems

3 Answers 162 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Corey Alguire
Top achievements
Rank 1
Corey Alguire asked on 24 Jun 2008, 03:22 PM
I just updated to the service pack release of Q1 Ajax controls, and I now have a fairly urgent problem with my RadScheduler. I am using an object datasource and had nearly everything I needed working nicely with the previous version. I am doing a lot with integrated ContextMenus.

After updating to the latest release, I can no longer seem to access date/time information for appointments in the Scheduler using the get_start() or get_end() methods. I seem to be accessing the appointment correctly, as code using get_id() is working fine. In addition, when I debug, the values I see for get_start() and get_end are both 'NaN'. The get_id() method is working fine, appointments render where they are supposed to- in general, everything looks right- but the start and end dates are just not accessible.

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 24 Jun 2008, 03:41 PM
Hi Corey,

I have just checked both the SP1 and SP2 versions and they both seem to work fine. Can you please send us the code that you are using to access the start and end time?

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Corey Alguire
Top achievements
Rank 1
answered on 24 Jun 2008, 03:47 PM
I have made some modifications to this for testing purposes since the problem cropped up, but here is my client-side script block:

<

telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">

<script type="text/javascript">

var selectedAppointment = null;

var isAllDayTimeSlot = null;

var contextMenuSlot = null;

function appointmentContextMenu(sender, eventArgs)

{

selectedAppointment = eventArgs.get_appointment();

var menu = $find("<%= aptContextMenu.ClientID %>");

var menuNoDel = $find("<%= aptContextMenuNoDelete.ClientID %>");

var kl = selectedAppointment._attributes.getAttribute('KannLoeschen');

if (kl != 'True')

{

menuNoDel.show(eventArgs.get_domEvent());

}

else{

menu.show(eventArgs.get_domEvent());

}

}

function appointmentContextMenuItemClicked(sender, eventArgs)

{

if (!selectedAppointment)

return;

switch (eventArgs.get_item().get_value())

{

case "Delete":

doAjaxRequest(

"Delete:" + selectedAppointment.get_id());

break;

case "Edit":

doAjaxRequest(

"Edit:" + selectedAppointment.get_id());

break;

case "Selection":

alert(selectedAppointment.get_id());

var start = selectedAppointment.get_start(); //convertToDateTime(selectedAppointment.get_start());

var end = selectedAppointment.get_end(); //convertToDateTime(selectedAppointment.get_end());

doAjaxRequest(

"Selection:" + start + ':' + end);

break;

}

selectedAppointment =

null;

}

function appointmentClicked(sender, eventArgs)

{

var apt = eventArgs.get_appointment();

var id = apt.get_id();

var aType = id.substr(0,2);

if (aType != "st")

{

doAjaxRequest(

"Arzt:" + id);

}

}

function timeSlotContextMenu(sender, eventArgs)

{

var menu = $find("<%= slotContextMenu.ClientID %>");

menu.show(eventArgs.get_domEvent());

isAllDayTimeSlot = eventArgs.get_isAllDay();

contextMenuSlot = eventArgs.get_targetSlot();

}

function timeSlotContextMenuItemClicked(sender, eventArgs)

{

switch (eventArgs.get_item().get_value())

{

case "NewWunschbesuch":

doAjaxRequest(

"Wunschbesuch:" + contextMenuSlot._startTime.toLocaleString() + '|' + isAllDayTimeSlot);

break;

case "NewOther":

doAjaxRequest(

"AddOther:" + contextMenuSlot._startTime.toLocaleString() + '|' + isAllDayTimeSlot);

break;

case "Selection":

var start = convertToDateTime(contextMenuSlot._startTime);

doAjaxRequest(

"Selection:" + start);

break;

}

}

function GVDateMove(dt)

{

doAjaxRequest(

"DateMove:" + dt);

}

function doAjaxRequest(data)

{

var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

ajaxManager.ajaxRequest(data);

}

function convertToDateTime(date)

{

//var year = date.getUTCFullYear();

//var month = date.getUTCMonth()+1;

//var day = date.getUTCDate();

//return day + '.' + month + '.' + year;

return date;

}

function hideActiveToolTip()

{

var controller = Telerik.Web.UI.RadToolTipController.getInstance();

var tooltip = controller.get_activeToolTip();

if (tooltip)

{

tooltip.hide();

}

}

function refreshScheduler()

{

var ajaxManager = $find("RadAjaxManager1");

ajaxManager.ajaxRequest(

'RebindScheduler');

}

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);

function beginRequestHandler(sender, args)

{

var prm = Sys.WebForms.PageRequestManager.getInstance();

if (args.get_postBackElement().id.indexOf('rsWork') != -1 || args.get_postBackElement().id.indexOf('rcCalendar') != -1)

{

hideActiveToolTip();

}

}

</script>

</telerik:RadScriptBlock>

0
Accepted
T. Tsonev
Telerik team
answered on 24 Jun 2008, 04:56 PM
Hello Corey,

You are correct indeed. The problem was only visible when the server was in different locale than the en-US one that I have used for testing earlier. We have managed to fix it and you should open a support ticket, so we can send you the hotfix. Your Telerik points have been updated for your involvement.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Corey Alguire
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Corey Alguire
Top achievements
Rank 1
Share this question
or