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

Can't read data from server, don't understand what happned, help

2 Answers 50 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ivan
Top achievements
Rank 1
ivan asked on 17 Nov 2014, 01:42 PM
Hi, I am testing the scheduler. I just set my code like the demo:

jQuery("#workcalendar").kendoScheduler({
     date: new Date(), // The current date of the scheduler
     selectable: true,
     snap: false,
     views: [
        {
           type: "month",
        },
        {
           type: "day"
        },
        {
           type: "week"
        }
        ,
        {
           type: "agenda"
        }
      ]
      ,
       dataSource:
       {
             batch: true,
             transport:
             {
               read:
               {
                   url: "KPIGetData/DimData.aspx?SearchInput=schedulerevent",
                   dataType: "json",
                   data: {"SearchValue":CurrentUserID,"StartTime":SearchTimeStart,"EndTime":SearchTimeEnd}
               }
             }
             ,
             schema:
             {
               model:
               {
                 id: "taskId",
                 fields:
                 {
                   taskId: { type: "number", from: "TaskID"},
                   title: { from: "Title"},
                   start: { type: "date", from: "Start" },
                   end: { type: "date", from: "End" },
                   description: { from: "TaskScript" },
                   recurrenceId: { from: "RecurrenceID" },
                   recurrenceRule: { from: "RecurrenceRule" },
                   recurrenceException: {from:"RecurrenceException"},
                   ownerId: {from: "OwnerID", defaultValue: 1},
                   isAllDay: {type: "boolean",from:"IsAllDay"}
                 }
               }
             },
              error: function(e) {
               alert(e.errors);
              }
       }
      
   });

The scheduler shows well. But the event don't be loaded from server.

The read URL returns this data:
[{"TaskID":4,"OwnerID":2,"Title":"Bowling tournament","Description":"","StartTimezone":null,"Start":"11/17/2014 12:00:00 AM","End":"11/17/2014 12:00:00 AM","EndTimezone":null,"RecurrenceRule":null,"RecurrenceID":null,"RecurrenceException":null,"IsAllDay":false}]

Note that this is just like the demo.
But no event showed, just nothing.

It take me over 5 hours, I really don't know what happened.

yours,
Ivan

2 Answers, 1 is accepted

Sort by
0
ivan
Top achievements
Rank 1
answered on 17 Nov 2014, 03:34 PM
After another 3 hours' dig,  I found that:
if the return Json is:
[{"TaskID":4,"OwnerID":2,"Title":"Bowling tournament","Description":"","StartTimezone":null,"Start":"11/17/2014 12:00:00 AM","End":"11/17/2014 12:00:00 AM","EndTimezone":null,"RecurrenceRule":null,"RecurrenceID":null,"RecurrenceException":null,"IsAllDay":false}]

No Event will show.

But if the return Json is:
[{"TaskID":4,"OwnerID":2,"Title":"Bowling tournament","Description":"","StartTimezone":null,"Start":"2014/11/20 12:00:00 ","End":"2014/11/20 12:00:00 ","EndTimezone":null,"RecurrenceRule":null,"RecurrenceID":null,"RecurrenceException":null,"IsAllDay":false}]

The event shows!

So the question is:
 What's the Right time text the scheduler will reg.

yours,
Ivan
0
Vladimir Iliev
Telerik team
answered on 19 Nov 2014, 09:36 AM
Hi Ivan,

I would suggest to send the dates to the scheduler using the ISO format as follows:

JSON.stringify(new Date())
//result: ""2014-11-19T09:34:33.181Z""

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
ivan
Top achievements
Rank 1
Answers by
ivan
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or