Daypilotライトカレンダーを実装しようとしています。これまでのところ、それはok-ishになっていますが、私はちょっとした打撃を受けたようです。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);
}
モーダル。 私が言及したように、私はここで何が起こっているのか分かりませんので、提供できるガイダンスは高く評価されます。