I'm having some trouble getting the scheduler to read a custom JSON array when I use the schema configuration element to map fields to my array.
I pass in the following element from a Web service:
[{"id":"1","title":"My Appointment","start":"\/Date(1406822400000)\/","end":"\/Date(1406829600000)\/","isAllDay":false,"timeZone":"America\/Phoenix"}]
It is bound. However, if I pass in this element from a JSON array (provided by the Web service:
[{"bookingId":"1","companyName":"My Appointment","serviceStartDateTime":"\/Date(1406822400000)\/","serviceEndDateTime":"\/Date(1406829600000)\/","isAllDay":false,"timeZone":"America\/Phoenix"}]
And provide this schema element:
{"id":"id","fields":{"id":{"field":"bookingId","type":"number"},"title":{"field":"companyName"},"start":{"field":"serviceStartDateTime","type":"date"},"end":{"field":"serviceEndDateTime","type":"date"},"isAllDay":{"field":"isAllDay","type":"boolean"}}}
I have also tried this schema element:
{"id":"id","fields":{"id":{"from":"bookingId","type":"number"},"title":{"from":"companyName"},"start":{"from":"serviceStartDateTime","type":"date"},"end":{"from":"serviceEndDateTime","type":"date"},"isAllDay":{"from":"isAllDay","type":"boolean"}}}
In both cases, data-binding fails. I finally had to connect the source KendoUI libraries so I could get a useful error. What it logs to my console is:
"TypeError: date is null" and the error occurs on kendo.all.js on line 3560.
After I back-traced it, I could see all the elements coming into the data-binding process, but start was null (serviceStartDateTime had the correct timestamp). So, it looks like Kendo UI Scheduler isn't mapping fields correctly. I just updated my library to the latest version. The header from my source file is:
/*
* Kendo UI v2014.2.903 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
Is this an error with Kendo UI or my configuration?
Thanks!
I pass in the following element from a Web service:
[{"id":"1","title":"My Appointment","start":"\/Date(1406822400000)\/","end":"\/Date(1406829600000)\/","isAllDay":false,"timeZone":"America\/Phoenix"}]
It is bound. However, if I pass in this element from a JSON array (provided by the Web service:
[{"bookingId":"1","companyName":"My Appointment","serviceStartDateTime":"\/Date(1406822400000)\/","serviceEndDateTime":"\/Date(1406829600000)\/","isAllDay":false,"timeZone":"America\/Phoenix"}]
And provide this schema element:
{"id":"id","fields":{"id":{"field":"bookingId","type":"number"},"title":{"field":"companyName"},"start":{"field":"serviceStartDateTime","type":"date"},"end":{"field":"serviceEndDateTime","type":"date"},"isAllDay":{"field":"isAllDay","type":"boolean"}}}
I have also tried this schema element:
{"id":"id","fields":{"id":{"from":"bookingId","type":"number"},"title":{"from":"companyName"},"start":{"from":"serviceStartDateTime","type":"date"},"end":{"from":"serviceEndDateTime","type":"date"},"isAllDay":{"from":"isAllDay","type":"boolean"}}}
In both cases, data-binding fails. I finally had to connect the source KendoUI libraries so I could get a useful error. What it logs to my console is:
"TypeError: date is null" and the error occurs on kendo.all.js on line 3560.
After I back-traced it, I could see all the elements coming into the data-binding process, but start was null (serviceStartDateTime had the correct timestamp). So, it looks like Kendo UI Scheduler isn't mapping fields correctly. I just updated my library to the latest version. The header from my source file is:
/*
* Kendo UI v2014.2.903 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
Is this an error with Kendo UI or my configuration?
Thanks!