0
我正在嘗試實施Daypilot lite日曆。到目前爲止,它是好的,但我似乎碰到了一些障礙。DayPilot日曆創建事件
我想在calander中創建一個新事件,但我似乎無法將除事件開始和結束之外的任何信息傳遞給daypilot模式。
JavaScript runtime error: 'team' is undefined
以上這行是我收到的錯誤。 在我的aspx頁面的控制代碼:
<h1>Welcome <asp:Label ID="lblTeam" runat="server"></asp:Label></h1>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" AppendDataBoundItems="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="0">Select a pitch</asp:ListItem>
</asp:DropDownList>
<DayPilot:DayPilotCalendar
ID="DayPilotCalendar1"
runat="server"
DataStartField="sess_start"
ShowEventStartEnd="true"
DataEndField="sess_end"
DataTextField="team"
DataIdField="BookingId"
ClientObjectName="dpc1"
TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="timeRangeSelected(start, end, team, pitch)"
OnCommand="DayPilotCalendar1_Command"
NonBusinessBackColor="Black"
HeightSpec="BusinessHoursNoScroll"
BusinessEndsHour="20"
OnEventMove="DayPilotCalendar1_EventMove"
EventMoveHandling="CallBack"
/>
我的JavaScript代碼,將數據發送到模式:
function timeRangeSelected(start, end, team, pitch) {
team = document.getElementById('<%= lblTeam.ClientID %>').innerText;
var pitchSel = document.getElementById('<%= DropDownList1.ClientID %>');
pitch = pitchSel.options[pitchSel.selectedIndex].value;
var modal = new DayPilot.Modal();
modal.top = 60;
modal.width = 300;
modal.opacity = 70;
modal.border = "10px solid #d0d0d0";
modal.closed = function() {
if (this.result == "OK") {
dpc1.commandCallBack('refresh');
}
dpc1.clearSelection();
};
modal.showUrl("New.aspx?start=" + start.toStringSortable() + "&end=" + end.toStringSortable() + "&r=" + team + "&pitch=" + pitch);
}
我需要能夠傳遞的不僅僅是開始和結束的模態。 正如我所提到的,我不太確定這裏發生了什麼,所以任何可以提供的指導將不勝感激。