Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Creating a visualization through app.visualization.get , is there a way in the javascript code to perform an action once the model properties are populated.
I don't have a lot of experience with the asynchronous nature of javascript
I would just like to log the visualization object to the console at the point in which vis.model.properties will have information. No matter where I stick the command, I can't seem to get it to return. Even in onRendered it is blank
app.visualization.get(visID).then(function(vis){
visualizations[$this.id] = vis;
vis.show($this.id, {onRendered: ()=>
console.log(vis)});
});
However if I wait until everything is loaded and then in the developer tools console, I reference it from my visualizations array it is stored to in line 2 above, the properties are there.
Is there a way to do this through the javascript?
Hi @dclark0699 ,
Hope this helps you, Use promice then() to log
app.visualization.get("0258ae15-f0e4-4585-b2ff-2cbd25b7bb44").then(function(vis){
vis.show("QV01").then(function(){
console.log(vis);
});
});
If you want to learn then you can surely get online help from below link