No problem, I'm glad that it's working.
> I see that DayPilot.Web.Mvc.Events.Gantt.RowClickHandlingType.CallBack is going to call back to my controller's ActionResult RowSelecting() method.
If you use "CallBack" event handling type it will fire the server side event. However, it doesn't call RowSelecting() method (that's the method that displays the /Gantt/RowSelecting demo). All CallBacks use an AJAX request to the URL specified using BackendUrl property of the calendar.
Example:
MVC View
@Html.DayPilotGantt("gantt", new DayPilotGanttConfig {
BackendUrl = Url.Action("Backend", "Gantt"),
// ...
RowClickHandling = DayPilot.Web.Mvc.Events.Gantt.RowClickHandlingType.CallBack,
RowClickJavaScript = "window.console && console.log(args);"
})
BackendUrl points to Gantt/Backend (public ActionResult Backend() method) which redirects the processing to the Gantt class.
The events are then handled by the respective method override. In this example, it is OnRowClick. This name is fixed (you need to override the method defined in DayPilotGantt class, the parent of Gantt):
MVC Controller
using System;
using System.Web.Mvc;
using DayPilot.Web.Mvc;
using DayPilot.Web.Mvc.Events.Gantt;
using DayPilot.Web.Mvc.Json;
namespace MvcApplication1.Controllers
{
[HandleError]
public class GanttController : Controller
{
public ActionResult RowClicking()
{
return View();
}
public ActionResult Backend()
{
return new Gantt().CallBack(this);
}
class Gantt : DayPilotGantt
{
protected override void OnInit(InitArgs e)
{
Tasks = new TaskManager(Controller, "default").TaskData;
Links = new TaskManager(Controller).LinkData;
ScrollTo(DateTime.Today);
UpdateWithMessage("Welcome!");
}
protected override void OnRowClick(RowClickArgs e)
{
Redirect("~/Gantt/RowSelecting");
}
}
}
}
You can use this method (OnRowClick) to process the event. In this case, it redirects the user to a new URL.
You can also do the redirect on the client side - see both examples in the new "Row Clicking" doc page:
http://doc.daypilot.org/gantt/row-clicking/
This example is now also available in the latest sandbox build (8.1.5818):
http://mvc.daypilot.org/sandbox/Gantt/RowClicking