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

Scheduler Drag and Drop

Asked by Anonymous
9 years ago.

Hello,

I have two Schedulers. I want to drag one event from Scheduler one and drop it into Scheduler two. The count of rows is different (Scheduler one has multiple rows and the second only one row).

I got an JavaScript Error.

this._createShadow = function(object, type) {
var maind = calendar.maind;
var coords = calendar._getShadowCoords(object);
var event = object.event;
var height = event.part.height || calendar.eventHeight;
var top = (event.part && event.part.top) ? (event.part.top + calendar.rows[event.part.dayIndex].Top) : coords.top;

calender.rows has a length of 1 but the event.part.dayIndex is not always zero (depends from which row I drag out the event)

=> rows at position 4 returns undefined and this raises an JavaScript Error

CONFIG OF THE SECOND SCHEDULER:

ID="SchedulerUnassignedTours"
runat="server"
ClientObjectName="calTours"
BorderStyle="None"
OnBeforeCellRender="OnSchedulerBeforeCellRender"
DurationBarVisible="false"
CellDuration="1440"
RowMinHeight="35"
CellWidth="75"
OnEventMove="OnSchedulerEventMove"
EventHeight="17"
EventClickHandling="JavaScript"
EventMoveMargin="14"
CellGroupBy="Week"
CellBorderColor="#999999"
OnBeforeEventRender="OnSchedulerBeforeEventRender" OnBeforeTimeHeaderRender="OnSchedulerBeforeTimeHeaderRenderDflt"
OnBeforeResHeaderRender="OnUnassignedSchedulerBeforeResHeaderRender"
EventBorderVisible="false"
EventBackColor="Transparent"
OnCommand="OnUnassignedSchedulerCommand"
ContextMenuID="U"
OnEventMenuClick="OnSchedulerMenuClick"
EventSortExpression="RosterOrderSortField asc"
DragOutAllowed="True"
SyncResourceTree="false"
RowMarginBottom="5"

Is there some configuration properties that I am missing?

regards

Comment posted by Anonymous
9 years ago.

Error Message: Uncaught TypeError: Cannot read property 'Top' of undefined

Comment posted by Anonymous
9 years ago.

I have replaced this line:
var top = (event.part && event.part.top) ? (event.part.top + calendar.rows[event.part.dayIndex].Top) : coords.top;
by this line:
var top = (event.part && event.part.top && calendar.rows[event.part.dayIndex]) ? (event.part.top + calendar.rows[event.part.dayIndex].Top) : coords.top;

Answer posted by Anonymous
9 years ago.

I have replaced this line:
var top = (event.part && event.part.top) ? (event.part.top + calendar.rows[event.part.dayIndex].Top) : coords.top;
by this line:
var top = (event.part && event.part.top && calendar.rows[event.part.dayIndex]) ? (event.part.top + calendar.rows[event.part.dayIndex].Top) : coords.top;

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