Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2515
How to capture data error for igDataChart using ig.DataSource
posted

I am using an ig.DataSource to retrieve data for an igDataChart. The code looks similar to the following. Sometimes the data retrieval fails. I can find no events for with ig.DataSource or igDataChart to capture any errors associated with the data retrievals.

Are there undocumented events that can be used?

ds = new $.ig.DataSource({ dataSource: dataUrl });

// Instantiate the chart
$chart.igDataChart({
dataSourceType: "remoteUrl",
dataSource: ds,
...
});

Parents
  • 17590
    Offline posted

    Hello Ray,

    Thank you for posting in our community.

    What I can suggest is using callback function when data binding is complete. This function has two arguments - success and error so that you can determine when in the error scenario and apply your logic there. For example:

    var render = function (success, error) {
        if (success) {
            alert("success");
        } else {
            alert(error);
        }
    }
     
    $(window).load(function () {
        var url = "">odata.netflix.com/.../Titles;
        ds = new $.ig.DataSource({
            type: "remoteUrl",
            callback: render,
            dataSource: url,
            schema: oDataSchema,
            responseDataKey : "d.results",
            responseDataType: "jsonp",
        });
        ds.dataBind();
    });

    Please let me know if you need any further assistance with this matter.

Reply Children