I’m trying to get the dhtmlxScheduler to work and I’ve followed every instruction there is, but I’ve hit a wall so to speak.
Following the instructions, i’ve created a DB with the required fields in MSSQL Server 2012, been able to initialize the scheduler and also been able to get XML-output from the DB with events, yet the scheduler does not seem to be recognizing them as it will not load those events into the scheduler.
Using MVC4 with the Razor engine, my code is as following
Controller:
[code]using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TimeSaverManager.Models;
namespace Manager.Controllers
{
public class CalendarController : Controller
{
//
// GET: /Calendar/
public ActionResult Index()
{
return View();
}
public ActionResult Data()
{
Response.ContentType = "text/xml";
TimesheetDataContext data = new TimesheetDataContext(); //Gets the events from the DB
return View(data.Timesheets);
}
}
}
[/code]
Data.cshtml:
[code]@inherits System.Web.Mvc.WebViewPage
@{
Layout = null;
}
Index.cshtml:
[code]@inherits System.Web.Mvc.WebViewPage
@{
Layout = null;
}
<style type="text/css">
html, body {
height:100%;
padding:0px;
margin:0px;
}
</style>
<script type="text/javascript">
function init() {
scheduler.config.xml_date = "%Y/%m/%d %H:%i"; // format of dates in XML
scheduler.init("scheduler_here", new Date(), "month");
scheduler.load("/Calendar/Data"); //path to the newly created action
}
</script>
The XML-output:
[code]
<start_date>
</start_date>
<end_date>
</end_date>
So my question is: What is stopping it from loading the events? Any help towards the solution of this problem is greatly appreciated, I’ve been stuck with this problem for 2 days now and I just cannot figure it out.