cancel
Showing results for 
Search instead for 
Did you mean: 

Widget refresh

Lisha
8 - Cloud Apps
8 - Cloud Apps

Hello,

I have added a widget script which performs my required action and at the end I want to refresh the widget.

Everything is working fine but the widget keeps on refreshing again and again. Is there a way to limit this so the widget is refreshed only once after the result is processed.

Below is the structure of the script used :

widget.on('processresult', function(widget, query) {

. .

. . 

. . 
widget.refresh();
});

 

3 REPLIES 3

Harry
9 - Travel Pro
9 - Travel Pro

Hello @Lisha ,

The 'processresult' event executes before the chart renders. So normally refresh is does not required in this event. Can you explain what action you are performing in 'processresult' event?

Always here to help,
Harry from QBeeQ
[email protected]
www.qbeeq.pl

Lisha
8 - Cloud Apps
8 - Cloud Apps

Hi @Harry 

I am changing the indicator color based on some specific conditions.

This has to be done using a script (and not via provided color formatting within widget) since it is a complex logic.  

Harry
9 - Travel Pro
9 - Travel Pro

Try below script to change color

ev.result.gauge.color = 'green'

Example:


widget.on('processresult',function(se, ev){

  var value = 5
  
  if(value > 5 )
  	ev.result.gauge.color = 'green'
  else 
	ev.result.gauge.color = 'red'
})

Always here to help,
Harry from QBeeQ
[email protected]
www.qbeeq.pl