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

Not displaying json data

3 Answers 276 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 20 Mar 2014, 11:57 AM
I have a scheduler that I am trying to displaying some events on. I have created a JSBin that shows what I am trying to do. The actual datasource has a transport defined that hits my webservice but I replaced the transport with the data that is actually returned and got the same results.

There should be some events displaying. Admittedly, this is my first scheduler. I started with copy/paste from the demos and tweaked from there. I am at a complete blank as to why those events are not showing up. The best I can think is that there must be a deserialization issue like maybe with the date format or something but that is, of course, a guess.

Any help would be greatly appreciated!

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 24 Mar 2014, 11:01 AM
Hello Michael,

There are a few reasons why no events are shown:
  • The data option should be at the root level of the DataSource object
  • The JSON string should be deserialized. Usually this is done by the DataSource itself when reading from remote source, however the data option takes an array of objects
  • ServerFiltering is used with local data
  • The end and start filters are using the today's date, so there are no matching items

Here is an updated version of the example, where the points above are revised.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 04 Apr 2014, 07:59 PM
Thank you for getting back to me. I am sorry for the long time to reply however I got stuck doing another task and am just now getting back to this. I'm sure you know how that goes. :)

Well apparently my attempt to cruft up an example the first time failed miserably. The actual datasource is to an API call, I was merely trying to show what data was actually being returned. I have updated the JSBIN and hopefully I did a better job this time.

This example does work as it should the way the code is. However if I comment out the data line and then uncomment the lines that are presently commented out, I get an error (Uncaught TypeError: Cannot read property '__count' of undefined). The text that is in the data line is the exact text being returned from the server.

It is an internal API else I would have just left that as the transport. The API is a ASP.NET/MVC and is configured with odata support. As I mentioned, the API does return valid data, it just causes errors.

If there is anything that you can tell me that I am doing wrong without actually being able to hit my internal API, I would be greatly appreciated!

Regards!



0
Alexander Popov
Telerik team
answered on 08 Apr 2014, 01:33 PM
Hi Michael,

Thank you for the example. I reviewed it and noticed that the DataSource is configured to work with OData (see demo). This means that the data should arrive in a format that is standard for the protocol. The names of the data array, the totals count and so on, could be customized through the respective DataSource schema options.

Regards,
Alexander Popov
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
Michael
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Michael
Top achievements
Rank 1
Share this question
or