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

3 posts, 0 answers
  1. ivan
    ivan avatar
    27 posts
    Member since:
    Aug 2013

    Posted 17 Nov 2014 Link to this post

    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. ivan
    ivan avatar
    27 posts
    Member since:
    Aug 2013

    Posted 17 Nov 2014 in reply to ivan Link to this post

    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
  3. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 19 Nov 2014 Link to this post

    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!
     
Back to Top