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

Failure to read remote DataSource

9 Answers 154 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Julia
Top achievements
Rank 1
Julia asked on 13 Jul 2016, 11:47 PM

This (http://dojo.telerik.com/OpupU) is a Dojo example that prints the length of a remote DataSource's data. When I substitute in a different URL (one running on my local machine) but don't change anything else, nothing gets logged to the console. In particular, the change function is never called.

Here is information about the data I'm trying to pull in:

The JSON data:

[{
  "tradeVolume": "33454327",
  "numberOfTrades": "130498",
  "tradeSizeStdDev": 13048.15096724034,
  "quoteSizeStdDev": 1306.394869511115,
  "medianTrade": 100.0,
  "eightiethTradeSize": 200.0,
  "ninetiethTradeSize": 334.2000000000029,
  "ninetyFifthTradeSize": 334.2000000000029,
  "ninetyEighthTradeSize": 1100.0,
  "ninetyNinthTradeSize": 2000.0,
  "medianQuoteSize": 1000.0,
  "eightiethQuoteSize": 1550.0,
  "ninetiethQuoteSize": 2050.0,
  "ninetyFifthQuoteSize": 2050.0,
  "ninetyEighthQuoteSize": 4300.0,
  "ninetyNinthQuoteSize": 5600.0,
  "ninetyNinthFiveQuoteSize": 7850.0
}]

Screenshots of the Chrome DevTools Network Headers and Response are linked here: https://i.imgsafe.org/6d2625717d.png and https://i.imgsafe.org/6d29a5a600.png
 

Can someone explain why the Dojo example isn't working when I substitute in my url containing the above data and tell me how I could fix it? I wonder if it has to do with the "keep-alive" connection.

 

Thanks!

9 Answers, 1 is accepted

Sort by
0
Julia
Top achievements
Rank 1
answered on 14 Jul 2016, 04:24 PM
Sorry, the previous screenshots are incorrect. These are the right ones of the Chrome DevTools Network Headers and Response: https://i.imgsafe.org/7bc4cf12d4.png and https://i.imgsafe.org/7bc3e2df8a.png
0
Dimiter Topalov
Telerik team
answered on 15 Jul 2016, 02:16 PM
Hi Julia,

Trying to open the provided screenshots resulted in an error (see the attachment). Can you please attach them to your response, and send them again.

In general, the Kendo UI DataSource works as expected, regardless of whether the remote data service is running on a remote server, or on the local machine. You can inspect the browser's developers tools (F12) console for JavaScript errors, and the Network tab to investigate what is happening with the request.

If the problem persists, please send us further details about the scenario and resulting issue, so we can provide further and more to-the-point suggestions.

Regards,
Dimiter Topalov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Julia
Top achievements
Rank 1
answered on 16 Jul 2016, 12:00 AM

Hi Dimiter,

I checked my browser's developers tools and the network tab, although the request was successful (i.e., I could see the json in Network/Response), it wasn't logging the length of the data to the console.

I tried creating a test.html file and hosting it on the same server as my remote data source. I changed the dataType from "jsonp" to "json", and added a schema model, since the data is an array of an object of objects (slightly different from the one I posted previously, see below).

[{
  "date": {
    "text": "2015-07-13"
  },
  "barData": {
    "tradeVolume": "33454327",
    "numberOfTrades": "130498",
    "tradeSizeStdDev": 13048.15096724034,
    "quoteSizeStdDev": 1306.394869511115,
    "medianTrade": 100.0,
    "eightiethTradeSize": 200.0,
    "ninetiethTradeSize": 334.2000000000029,
    "ninetyFifthTradeSize": 334.2000000000029,
    "ninetyEighthTradeSize": 1100.0,
    "ninetyNinthTradeSize": 2000.0,
    "medianQuoteSize": 1000.0,
    "eightiethQuoteSize": 1550.0,
    "ninetiethQuoteSize": 2050.0,
    "ninetyFifthQuoteSize": 2050.0,
    "ninetyEighthQuoteSize": 4300.0,
    "ninetyNinthQuoteSize": 5600.0,
    "ninetyNinthFiveQuoteSize": 7850.0
  }
}]

 

Here's another Dojo with the content of my test.html file: http://dojo.telerik.com/@juliayu/apEHA. Although you won't be able to access the url, here are the things I tried (the code for each of these is in the Dojo link, and some are commented out):

  1. Logging the length of the data and the data itself whenever the remote DataSource is changed. This didn't print the right information (i.e., it wasn't an observable object containing the json data) .
  2. Calling the fetch method on the remote DataSource and logging the data. This also didn't print the right information.
  3. Printing the remote DataSource data twice after calling the read method. This didn't work either.

I'm sorry you weren't able to open my screenshots. I'll try attaching the files again when I get off work.

 

Thanks!
Julia

 

0
Julia
Top achievements
Rank 1
answered on 16 Jul 2016, 12:06 AM
Here are the images
0
Julia
Top achievements
Rank 1
answered on 16 Jul 2016, 12:07 AM
Here are the images
0
Julia
Top achievements
Rank 1
answered on 16 Jul 2016, 01:02 AM
Here are the images
0
Julia
Top achievements
Rank 1
answered on 19 Jul 2016, 06:17 AM

Sorry, the above were the original screenshots. The ones attached here are the ones corresponding to the newest post.

0
Dimiter Topalov
Telerik team
answered on 19 Jul 2016, 12:15 PM
Hello Julia,

The Kendo UI  DataSource change event is fired whenever tha dataSource is populated, an item is changed, added, or removed, and when a the data is paged, sorted, filtered, or grouped:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-change

The dataSource schema, and schema.model are described in the following sections of the API reference:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.model

... and a thorough Overview is available in the following section:

http://docs.telerik.com/kendo-ui/framework/datasource/overview

I have prepared a simple dojo illustrating some of the dataSource's methods and the change event. You can find out more in our online demos, and all - in the API reference:

http://demos.telerik.com/kendo-ui/datasource/index

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource

Let us know if you have other questions about Kendo UI.

Regards,
Dimiter Topalov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Gesly
Top achievements
Rank 1
answered on 19 Jul 2016, 11:04 PM

Thanks for the links Dimiter! I was able to get it to work.

For reference, my schema definition was wrong. Here's a Dojo with the working code: http://dojo.telerik.com/@juliayu/apEHA/4

Tags
Data Source
Asked by
Julia
Top achievements
Rank 1
Answers by
Julia
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Gesly
Top achievements
Rank 1
Share this question
or