Hello,
I am trying to dynamically color the scheduler slots based on working day which could be different for each user or each day.
So, following directions, I have added
scheduler.BeforeInit.Add(“configure();”);
to the controller method
and the following method in the controller
public ContentResult Timespans()
{
var from = DateTime.ParseExact(this.Request.QueryString[“from”], “yyyy-MM-dd”, CultureInfo.InvariantCulture);
var to = DateTime.ParseExact(this.Request.QueryString[“to”], “yyyy-MM-dd”, CultureInfo.InvariantCulture);
IList<DHXMarkTime> arrayOfTimespans = new List<DHXMarkTime>();
//set the block time
arrayOfTimespans.Add(new DHXMarkTime()
{
Zones = new List<Zone>() { new Zone { Start = 0, End = 9 * 60 }, new Zone { Start = 17 * 60, End = 24 * 60 } },
CssClass = "schedule_block",
FullWeek = true
}
);
//now set the working day styles
//set the block time
arrayOfTimespans.Add(new DHXMarkTime()
{
Zones = new List<Zone>() { new Zone { Start = 0, End = 9 * 60 }, new Zone { Start = 17 * 60, End = 24 * 60 } },
InvertZones = true,
CssClass = "schedule_working",
FullWeek = true
}
);
return (ContentResult)new SchedulerAjaxData(arrayOfTimespans);
}
I get everything properly except the zones.
Here is the returned data:
"[{“SpanType”:“Default”,
“CssClass”:“schedule_block”,
“StartDate”:“01/01/0001 0:00”,
“Day”:“Sunday”,
“Zones”:“System.Collections.Generic.List1[DHTMLX.Scheduler.Zone]\", \"Sections\":\"System.Collections.Generic.List
1[DHTMLX.Scheduler.Section]”,
“FullDay”:false,
“FullWeek”:true,
“EndDate”:“01/01/0001 0:00”,
“HTML”:null,
“InvertZones”:false},
{“SpanType”:“Default”,
“CssClass”:“schedule_working”,
“StartDate”:“01/01/0001 0:00”,
“Day”:“Sunday”,
“Zones”:“System.Collections.Generic.List1[DHTMLX.Scheduler.Zone]\", \"Sections\":\"System.Collections.Generic.List
1[DHTMLX.Scheduler.Section]”,
“FullDay”:false,
“FullWeek”:true,
“EndDate”:“01/01/0001 0:00”,
“HTML”:null,“InvertZones”:true}]"
As you can see, instead of the actual zones, I am getting
“Zones”:“System.Collections.Generic.List`1[DHTMLX.Scheduler.Zone]”,
How do I fix this?
I am using Scheduler.Net version version 3.0.1.10
Thanks,
Mehnaz