Hi,
I am newly used kendo ui scheduler control. i want to load data's based on from and to date (Kendo ui datepicker used). the datasource read function fetch the datas, but it doesn't show anything. this is my below code. please anyone suggest me, is any mistake in my scheduler coding or JSON data.
Thanks in advance.
scheduler coding:
Loadscheduler: function () {
var formatted_date = new Date($("#txtfrmdate").data("kendoDatePicker").value());
var yyyy = formatted_date.getFullYear();
var dd = formatted_date.getDate();
var mm = formatted_date.getMonth() + 1;
var param = '&fromdate=' + $('#txtfrmdate').val() +
'&todate=' + $('#txttodate').val();
$("#calendarviewgrid").html("");
$("#calendarviewgrid").kendoScheduler({
date: new Date(formatted_date),
startTime: new Date(yyyy, mm, dd, 6, 0, 0),
endTime: new Date(yyyy, mm, dd, 22, 0, 0),
height: 600,
views: [{ type: "week", selected: true}],
editable: false,
dataSource: {
batch: true,
transport: {
read: {
url: "Controller/Enquiry/Enquiry.ashx?cmd=calendarview" + param,
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
}
},
schema: {
model: {
id: "TaskId",
fields: {
taskID: { from: "TaskId", type: "number" },
title: { from: "Title", defaultValue: "No title", validation: { required: true} },
start: { type: "date", from: "Start" },
end: { type: "date", from: "End" }
}
}
}
});
}
My JSON Data:
[{"TaskId":1,"Title":"WS - HIPE","Start":"\/Date(1483432200000)\/","End":"\/Date(1483435800000)\/"},{"TaskId":2,"Title":"WS - HIPM","Start":"\/Date(1483435800000)\/","End":"\/Date(1483438500000)\/"},{"TaskId":3,"Title":"WS - HIPC","Start":"\/Date(1483439400000)\/","End":"\/Date(1483441200000)\/"},{"TaskId":4,"Title":"WS - HIPM","Start":"\/Date(1483525800000)\/","End":"\/Date(1483529400000)\/"},{"TaskId":5,"Title":"WS - HIPB","Start":"\/Date(1483529400000)\/","End":"\/Date(1483533000000)\/"},{"TaskId":6,"Title":"WS - HIPE","Start":"\/Date(1483696800000)\/","End":"\/Date(1483700400000)\/"},{"TaskId":7,"Title":"WS - HIPM","Start":"\/Date(1483700400000)\/","End":"\/Date(1483703100000)\/"},{"TaskId":8,"Title":"WS - HIPC","Start":"\/Date(1483704000000)\/","End":"\/Date(1483705800000)\/"}]