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

Is it possible to get the same event of DayPilot on Gridview OnRawCommand ?

Asked by Anonymous
3 years ago.

I have a DayPilotCalendar, which shows tasks on each day. By clicking on each task, it will redirect to corresponding edit page (using the event EventClickJavaScript="ask(e)"). My doubt is that, Is it possible to do the same on a gridview? Means all task details will be displayed on a grid view. By clicking on each raw, it should redirect to the corresponding task's edit page. How can I get this 'e' of EventClickJavaScript of DayPilotCalendar?

<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<script src="Scripts/DayPilot/modal.js" type="text/javascript"></script>
<script src="Scripts/DayPilot/event_handling.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);
}

Answer posted by Dan Letecky [DayPilot]
3 years ago.

The 'e' variable holds a DayPilot.Event object. You can create it using the constructor:
https://api.daypilot.org/daypilot-event-constructor/

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