e.NewResource Всегда равен нулю в календаре Daypilot.
Привет, я новичок в календаре Day Pilot. Я использую веб-форму решения для дневного пилота с VB.NET . в event_move я получаю e.NewResource всегда ничего. это то, что я сделал в коде.
<div style="float: right; width: 85%">
<DayPilot:DayPilotMonth
ID="DayPilotMonth1"
runat="server"
DataServerTagFields="Color"
DataEndField="EndDate"
DataStartField="StartDate"
DataTextField="Title"
DataResourceField="DateFlag"
DataIdField="Id"
DataValueField="Id"
DataTagFields="Title, Id"
EventClickHandling="JavaScript"
EventClickJavaScript="edit(e);"
ClientObjectName="dpm"
EventMoveHandling="JavaScript"
EventMoveJavaScript="monthEventMoved(e, newStart, newEnd )"
OnEventMove="DayPilotCalendar1_EventMove"
Width="100%"
EventResizeHandling="JavaScript"
EventResizeJavaScript="monthEventResized(e, newStart, newEnd)"
OnEventResize="DayPilotMonth1_EventResize"
OnTimeRangeSelected="DayPilotMonth1_TimeRangeSelected"
OnBeforeEventRender="DayPilotMonth1_BeforeEventRender"
ShowToolTip="false"
EventStartTime="false"
EventEndTime="false"
OnCommand="DayPilotMonth1_Command"
OnBeforeCellRender="DayPilotMonth1_BeforeCellRender"
OnEventClick="DayPilotMonth1_EventClick"
ContextMenuSelectionID="DayPilotMenuSelection"
>
</DayPilot:DayPilotMonth>
<div class="row calendar" id="weekDView" style="display: none;">
<div class="col-md-12">
<div style="width: 8%; float: left">
<DayPilot:DayPilotNavigator ID="DayPilotNavigator3" runat="server"
ClientObjectName="dpn12"
BoundDayPilotClientObjectName="detailsDayPilotCalendar1"
SelectMode="Week" CssOnly="true" EnableTheming="true" CssClassPrefix="navigator_8"
ShowMonths="3"
SkipMonths="3"
DataStartField="StartDate"
DataEndField="Enddate"
VisibleRangeChangedHandling="CallBack"
OnVisibleRangeChanged="DayPilotNavigator3_VisibleRangeChanged"
ShowWeekNumbers="true"
OnTimeRangeSelected="DayPilotNavigator1_TimeRangeSelected"
OnBeforeCellRender="detailsDayPilotCalendar1_BeforeCellRender"
RowsPerMonth="Auto"></DayPilot:DayPilotNavigator>
</div>
<div style="float: right; width: 85%">
<DayPilot:DayPilotCalendar ID="detailsDayPilotCalendar1" runat="server" HeightSpec="Full"
DataStartField="StartDate" DataEndField="Enddate" DataTextField="Title" DataIdField="Id" DataValueField="Id"
DataAllDayField="IsAllDay"
DataServerTagFields="Color"
EventMoveHandling="JavaScript"
EventMoveJavaScript="detailsEventMoved(e, newStart, newEnd, newResource)"
OnEventMove="detailsDayPilotCalendar1_EventMove"
ViewType="Week"
OnTimeRangeSelected="detailsDayPilotCalendar1_TimeRangeSelected"
DataResourceField="DateFlag"
TimeRangeSelectedJavaScript="create(start, end)"
EventDeleteHandling="Disabled"
EventResizeHandling="JavaScript"
EventResizeJavaScript="detailsEventResized(e, newStart, newEnd)"
OnEventResize="detailsDayPilotCalendar1_EventResize"
EventClickHandling="JavaScript"
EventClickJavaScript="edit(e);"
EventSelectHandling="JavaScript"
xHeightSpec="BusinessHoursNoScroll"
OnEventClick="detailsDayPilotCalendar1_EventClick"
ClientObjectName="detailsDayPilotCalendar1"
EventEditHandling="CallBack"
OnBeforeEventRender="detailsDayPilotCalendar1_BeforeEventRender"
OnBeforeHeaderRender="detailsDayPilotCalendar1_BeforeHeaderRender"
EventSelectColor="red"
ShowAllDayEvents="True"
xShowToolTip="true"
xEventHoverHandling="Disabled"
TimeFormat="Auto"
OnTimeRangeMenuClick="detailsDayPilotCalendar1_TimeRangeMenuClick"
OnCommand="detailsDayPilotCalendar1_Command"
OnBeforeCellRender="detailsDayPilotCalendar1_BeforeCellRender"
EventArrangement="Full"
OnBeforeTimeHeaderRender="detailsDayPilotCalendar1_BeforeTimeHeaderRender"
AfterRenderJavaScript="afterRender(isCallBack);"
CellHeight="25"
HourWidth="60" />
</div
Функция Js
function monthEventMoved(e, newStart, newEnd) {
var selectedJobType = document.getElementById('ddlJobType').value; // jQuery
dpm.clientState = { jobType: selectedJobType };
if (confirm('Do you really want to reschedule this job?')) { dpm.eventMoveCallBack(e, newStart, newEnd); }
}
Код позади
Protected Sub DayPilotCalendar1_EventMove(sender As Object, e As EventMoveEventArgs)
Dim S = e.NewResource
'_jobService.UpdateJobSartEndDate(Convert.ToInt64(e.Value), e.NewStart, e.NewEnd)
_jobService.JobUpdateStartEndDateOnMove(Convert.ToInt64(e.Value), e.NewStart, e.NewEnd)
Dim crewId As Long = 0
Dim jobType As String = ""
If Not String.IsNullOrEmpty(DayPilotMonth1.ClientState("crewId")) Then
crewId = Convert.ToInt32(DayPilotMonth1.ClientState("crewId").ToString())
End If
If Not String.IsNullOrEmpty(DayPilotMonth1.ClientState("jobType")) Then
jobType = (DayPilotMonth1.ClientState("jobType").ToString())
End If
BindJobs(DayPilotMonth1.VisibleStart, DayPilotMonth1.VisibleEnd, crewId, jobType)
DayPilotMonth1.DataBind()
DayPilotMonth1.UpdateWithMessage("Job moved.")
End Sub
У меня нет никаких других проблем, кроме как получить e.NewResource всегда ничего. Пожалуйста, помогите, если кто-нибудь знает решение.