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

New Notify Model (6.8 SP1) issues with events

Asked by Mike
12 years ago.

I just upgraded from Pro 5.8 (build 1956) to Pro 6.8 SP1 (build 2477) and actually rebuilt my entire page based upon the Nofity.aspx page in the Demo folder. Upon doing so I found the following differences in behavior between the Notify functionality and the "original" (non-Notify) functionality. Please refer to the DayPilot Pro Demo files:
===================
Scheduler/Notify.aspx.cs
===================
During an event move (protected void DayPilotScheduler1_EventMove) the "Old" properties are no longer set correctly:
[] e.NewStart is the same as e.OldStart
[] e.NewEnd is the same as e.OldEnd
[] e.NewResource is the same as e.OldResource

In the non-Notify modal example (Scheduler/Default.aspx), when performing an "external drag" onto the scheduler the e.OldResource value is null. In the Notify example all Old values match the New values. If this cannot be acheived, can a new property be created so that it can be determined if the move is an "external" drag or not?

===================
Scheduler/Notify.aspx
===================
When the DayPilot control is set as follows:
<DayPilot:DayPilotScheduler
EventMoveJavaScript="customMove(e, newStart, newEnd, newResource);"

And regardless if NotifyCommit is set to "Queue" or "Immediate", the JS customMove function is never fired:
function customMove(e, newStart, newEnd, newResource) {
alert("test");
dps1.eventMoveCallBack(e, newStart, newEnd, newResource);
}

Also in Scheduler/Notify.aspx
The AfterRenderJavaScript="afterRender(data, isCallBack);" option has historically been great. However, with the new Notify modal, using the method DayPilotScheduler1.UpdateWithMessage("Event moved.") doesn't cause a re-rendering and thus no client-side javascript function is fired. Can a javascript function/event been created to capture when a callback action is detected? I already see that an error callback function exists, but not one for successful callbacks. Perhaps even providing a JS override so we can intercept before the "Event moved." message is displayed. Or allowing data to be passed back [DayPilotScheduler1.UpdateWithMessage("Event moved.", someDataVariable)] in the callback and it being intercepted even when a re-render does not occur.
The main reason for this request is that I have items that are "externally" dragged onto the scheduler and after the callback returns (indicating that the database was updated with my newly dragged-on item) I have to update the externally dragged icon from an arrow icon to a checkmark icon. I currently have to use the following div with the dragStart function passing in null as the first parameter so that it will not remove the element after dragged: <div style="cursor: move;" onmousedown="return DayPilotScheduler.dragStart(null, 251940, '497', '(5 MSPS) GC-336-10');" unselectable="on"><img id=" ctl02_imgGvRow" title="Drag to schedule" src=" /images/arrow.png" align="absmiddle" style="border-width:0px;" /></div>

Unfortunately, passing in null causes the drag action in IE 8 (and 7 I believe) to be more of a Click-Drag-ReleaseClick-ThenClickToSchedule action. Is there any way of working with the dragStart function to get different functionality? Or can the dragStart function be modified to better work with null values as the first parameter so that the dragging functionality acts properly?

===================
Event Removing
===================
I am also having problems with the Notify model with removing events. I have a ContextMenu that properly displays when an event is right clicked:
<DayPilot:DayPilotMenu ID="RightClickMenu" runat="server" CssClassPrefix="menu_">
<DayPilot:MenuItem Text="Remove" Action="JavaScript" Command='removeEvent' JavaScript="if (confirm('Are you sure you want to remove this?')) removeSchedEvent(e, command)" />
</DayPilot:DayPilotMenu>

function removeSchedEvent(e, command) {
var event = dps1.events.find(e.data.value);
dps1.events.remove(event).notify();
}

Upon executing the dps1.events.remove() function an exception is thrown in one of those temporary “WebResource_3.axd” files saying “Microsoft JScript runtime error: Object doesn't support this property or method” and the following portion of text highlighted: var $0U=$f.events.list.indexOf(e.data);
For context, the beginning portion of this file starts with
if(typeof DayPilot==='undefined'){var DayPilot={};};if(typeof DayPilotScheduler==='undefined'){var DayPilotScheduler=DayPilot.SchedulerVisible={};};(function(){if(typeof DayPilot.Scheduler!=='undefined'){return;};var DayPilotScheduler={};var $a=function(){};DayPilotScheduler.moving=null

Should I be deleting events a different way? I really prefer to use the ContextMenu route as it is a very elegant approach.

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

Mike, I'm working on it. It should be possible to resolve most of the issues.

The last issue is already fixed in 6.9 release:

http://www.daypilot.org/daypilot-pro-for-asp-net-webforms-6-9.html

“Microsoft JScript runtime error: Object doesn't support this property or method” is referring to Array.indexOf() method which is not implemented in IE up to version 8 (inclusive).

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

Mike,

All the issues should be fixed now in build 2508 (see the sandbox at http://www.daypilot.org/sandbox/ and the list of changes here - http://www.daypilot.org/daypilot-pro-for-asp-net-webforms-7-0.html.

1. Fixed in build 2508.

2. Fixed in build 2508.

Note: I wasn't able to reproduce the IE8 external drag&drop error (at least with the latest build). If the error persists, please create a new question with the reproduction steps or send it to support@daypilot.org.

3. Fixed already in the latest public release (6.9).

Comment posted by Mike
12 years ago.

Thanks so much Dan for your continued support; greatly appreciate it!

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