Hello,
I created a sample with scheduler and I added dataManager and some schedule data with the help of asp.net core Data Binding tutorial. But my data doesn't show on the calendar. Can you help me figure this out?
the View:
@using Syncfusion.EJ2;
@using Syncfusion.EJ2.Schedule;
@{
var dataManager = new DataManager()
{
Url = "GetData",
Adaptor = "UrlAdaptor",
CrossDomain = true
};
}
@{
ViewBag.Title = "Schedule";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Schedule Features:</h2>
<br />
<li> Schedule Samples - Default</li>
<li> Theme - Bootstrap-Theme</li>
<br />
<div id="ControlRegion">
<ejs-schedule id="schedule" height="550px" selectedDate="new DateTime(2018, 2, 15)">
<e-schedule-eventsettings dataSource="dataManager"></e-schedule-eventsettings>
</ejs-schedule>
</div>
controller:
[HttpPost]
public JsonResult GetData()
{
var data = new ScheduleData().GetScheduleData();
return Json(data);
}
public ActionResult ScheduleFeatures()
{
return View();
}
public class ScheduleData
{
public List<AppointmentData> GetScheduleData()
{
List<AppointmentData> appData = new List<AppointmentData>();
appData.Add(new AppointmentData
{
Id = 1,
Subject = "Explosion of Betelgeuse Star",
StartTime = new DateTime(2018, 2, 11, 9, 30, 0),
EndTime = new DateTime(2018, 2, 11, 11, 0, 0),
CategoryColor = "#1aaa55"
});
appData.Add(new AppointmentData
{
Id = 2,
Subject = "Thule Air Crash Report",
StartTime = new DateTime(2018, 2, 12, 12, 0, 0),
EndTime = new DateTime(2018, 2, 12, 14, 0, 0),
CategoryColor = "#357cd2"
});
return appData;
}
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string CategoryColor { get; set; }
}
}
}
Attachment:
EssentialJS2WebApplication4_b0969dba.rar