cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

refresh widgets

GianVal
15-Moonstone

refresh widgets

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!

ACCEPTED SOLUTION

Accepted Solutions

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

 

View solution in original post

2 REPLIES 2

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

Announcements

Top Tags