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,... });
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(
() {
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.
I did the following but the callback function was never called. I assume the ds.DataBind() occurs automatically when the ig.DataSource is used by the chart because my chart is being populated as expected.
ds = new $.ig.DataSource({ dataSource: dataUrl,type: "remoteUrl", callback: function (success, error) { debugger; if (!success) { alert(error); } }
// Instantiate the chart$chart.igDataChart({dataSourceType: "remoteUrl",dataSource: ds,...});