This is a migrated thread and some comments may be shown as answers.

Scheduler doesn't load JSON datas

1 Answer 239 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rajan
Top achievements
Rank 1
Rajan asked on 23 Dec 2016, 08:01 AM

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)\/"}]

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 26 Dec 2016, 10:09 AM
Hello Rajan,

As mentioned in the support ticket regarding the same issue - this happens because the schema is declared outside of the DataSource, so the start and end date strings are not being parsed.

Regards,
Alexander Popov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
Rajan
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or