The latest sandbox build now contains a demo page that shows a hierarchy of resources:
http://mvc.daypilot.org/sandbox/Calendar/DaysResources
The sources is a modified Calendar/Index example.
1. The following two lines are added to the view:
ViewType = DayPilot.Web.Mvc.Enums.Calendar.ViewType.Resources,
HeaderLevels = 2,
2. It adds the resources on the server side during the first automatic AJAX call (OnInit):
protected override void OnInit(InitArgs initArgs)
{
UpdateWithMessage("Welcome!", CallBackUpdateType.Full);
if (Id == "days_resources") // just applying it to DaysResources view
{
Columns.Clear();
Column today = new Column(DateTime.Today.ToShortDateString(), DateTime.Today.ToString("s"));
today.Children.Add("A", "a", DateTime.Today);
today.Children.Add("B", "b", DateTime.Today);
Columns.Add(today);
Column tomorrow = new Column(DateTime.Today.AddDays(1).ToShortDateString(), DateTime.Today.AddDays(1).ToString("s"));
tomorrow.Children.Add("A", "a", DateTime.Today.AddDays(1));
tomorrow.Children.Add("B", "b", DateTime.Today.AddDays(1));
Columns.Add(tomorrow);
}
}