Hi !!
Ive just started using DHTML scheduler but have run into some problems…
I try to populate the scheduler with ajax, but it wont render anything… Hope someone can help…
setup scheduler:
$("#myscheduler").dhx_scheduler({
xml_date: “%Y-%m-%d %H:%i”,
date: new Date(2013, 7, 19),
first_hour: 8,
last_hour: 17,
mode: “week”
});
ajax function:
function GetSchemaSessions(id) {
$.ajax({
url: “@Url.Content(”~/SkolePlanlegging/SessionSchema/GetSchemaSessions")",
type: ‘POST’,
data: { id: id },
success: function (data) {
scheduler.parse(data, “json”);
scheduler.updateView();
},
dataType: “text”
});
}
The data it returns looks ok, but nothing is showing… Return data looks like this:
“{“ContentEncoding”:null,“ContentType”:null,“Data”:
[{“id”:“35be59c8-7905-4c3a-8286-cc05f0188357”,“start_date”:“2013-08-20 11:10”,“end_date”:“2013-08-20 13:10”,“text”:“Test”,“session_type”:“0”}
,{“id”:“3c1de3ca-b0c9-42ef-945c-12ed650f012c”,“start_date”:“2013-08-19 13:55”,“end_date”:“2013-08-19 14:40”,“text”:“Test”,“session_type”:“0”}
,{“id”:“2f63fdff-561a-4f0b-9274-5e156e4cb30c”,“start_date”:“2013-08-19 10:25”,“end_date”:“2013-08-19 11:45”,“text”:“Yalla”,“session_type”:“1”}
],“JsonRequestBehavior”:1}”
What am I doing wrong… Any ideas is appreciated… Thanx…
-=Staale=-