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.