Failure to read remote DataSource

10 posts, 0 answers
  1. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 13 Jul Link to this post

    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!

  2. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 14 Jul in reply to Julia Link to this post

    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
  3. Kendo UI is VS 2017 Ready
  4. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    353 posts

    Posted 15 Jul Link to this post

    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.
     
  5. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 15 Jul in reply to Dimiter Topalov Link to this post

    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

     

  6. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 15 Jul Link to this post

    Here are the images
  7. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 15 Jul Link to this post

    Here are the images
  8. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 15 Jul Link to this post

    Here are the images
  9. Julia
    Julia avatar
    11 posts
    Member since:
    Jun 2016

    Posted 19 Jul in reply to Julia Link to this post

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

  10. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    353 posts

    Posted 19 Jul Link to this post

    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.
     
  11. Gesly
    Gesly avatar
    1 posts
    Member since:
    Jul 2016

    Posted 19 Jul in reply to Dimiter Topalov Link to this post

    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

Back to Top
Kendo UI is VS 2017 Ready