Skip to content

Commit 082427d

Browse files
committed
Merge pull request #70 from Andries-Smit/patch-1
Error Loading data view without context
2 parents 9ce97e0 + 279e5f7 commit 082427d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/ChartJS/widgets/Core.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,18 @@ define([
131131
if (this._handle !== null) {
132132
mx.data.unsubscribe(this._handle);
133133
}
134-
this._handle = mx.data.subscribe({
135-
guid: this._mxObj.getGuid(),
136-
callback: lang.hitch(this, this._loadData)
137-
});
138-
139-
// Load data again.
140-
this._loadData();
141-
134+
if(this._mxObj) {
135+
this._handle = mx.data.subscribe({
136+
guid: this._mxObj.getGuid(),
137+
callback: lang.hitch(this, this._loadData)
138+
});
139+
140+
// Load data again.
141+
this._loadData();
142+
domStyle.set(this.domNode, "display", "");
143+
} else {
144+
domStyle.set(this.domNode, "display", "none");
145+
}
142146
if (typeof callback !== "undefined") {
143147
callback();
144148
}

0 commit comments

Comments
 (0)