我有一个DayPilotCalendar
,它显示每天的任务。通过单击每个任务,它将重定向到相应的编辑页面(使用事件EventClickJavaScript="ask(e)"
)。我的疑问是,是否可以在 a 上做同样的事情gridview
?这意味着所有任务详细信息都将显示在网格视图上。通过单击每个 raw,它应该重定向到相应任务的编辑页面。我怎样才能'e'
得到EventClickJavaScript
这个DayPilotCalendar
?
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<script src="Scripts/DayPilot/modal.js" type="text/javascript"></script>
<DayPilot:DayPilotCalendar
ID="DayPilotCalendarDay"
runat="server"
ClientObjectName="dp_day"
DataEndField="end_time"
DataStartField="start_time"
DataTextField="task_name"
DataValueField="task_id"
DataRecurrenceField="recurrence"
Theme="timetable_simple"
ViewType="Day"
TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="create(start, end, resource);"
EventMoveHandling="CallBack"
EventResizeHandling="CallBack"
OnCommand="DayPilotCalendarDay_Command"
EventClickHandling="JavaScript"
EventClickJavaScript="ask(e)"/>
function ask(e) {
// it's a normal event
if (!e.recurrent()) {
edit(e);
return;
}
// it's a recurrent event but it's an exception from the series
if (e.id() !== null) {
edit(e);
return;
}
var modal = new DayPilot.Modal();
modal.closed = function () {
if (this.result != "cancel") {
edit(e, this.result);
}
};
modal.showUrl("RecurrentEditMode.html");
}
function edit(e, mode) {
var url = "EditTask.aspx?q=1"
if (e.recurrentMasterId()) {
url += "&master=" + e.recurrentMasterId();
}
if (e.value() !== null) {
url += "&id=" + e.id();
}
if (mode == "this") {
url += "&start=" + e.start();
}
createModal().showUrl(url);
}