Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello, I'm filling a list widget with some data and noticed that the widget itself does not show updated data while the code executes. some console.log show that is not a matter of data updating but the widget needs a graphical refresh (e.g. click on the screen) to be refreshed and show correct data. My question is: how to perform a forced refresh of the widget from the source javascript code?
Thank you!
Solved! Go to Solution.
depending on widget type could differ. The simple thing is after setting some properties to call:
$scope.$applyAsync()
some time is better
$scope.setWidgetProp("widgetname","prop", value)
//better as setting the property $scope.view.wdg['widgetname']=value
$scope.$applyAsync()
or call it inside $timeout construct
for some other widgets like charts , possibly we need a extra update method like:
$scope.app.fn.triggerWidgetService("timeSeriesChart-1","updateChart");
so if this mention above does not help, please, provide simples example to reproduce and understand the issue. Thanks
depending on widget type could differ. The simple thing is after setting some properties to call:
$scope.$applyAsync()
some time is better
$scope.setWidgetProp("widgetname","prop", value)
//better as setting the property $scope.view.wdg['widgetname']=value
$scope.$applyAsync()
or call it inside $timeout construct
for some other widgets like charts , possibly we need a extra update method like:
$scope.app.fn.triggerWidgetService("timeSeriesChart-1","updateChart");
so if this mention above does not help, please, provide simples example to reproduce and understand the issue. Thanks
"$scope.$applyAsync()" correctly worked, Anyway, as usual, I could not find comprehensive documentation about methods, API, etc. It could be very useful
Thank you