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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to stop reloading the data in grid on auto-refresh?

rpatil-21
2-Guest

How to stop reloading the data in grid on auto-refresh?

Hello All,

I have grid, I am getting grid data from the database. I am calling that service on auto-refresh. Refresh interval for auto refresh is 4 sec.

So on every 4 sec data is getting reloaded for grid. The grid is blinking in every 4 sec.

I don't want grid to blink. The data should get loaded only when it is changed.

Can anyone please help me? This is very urgent.

Thanks in advance.

Regards,

Renuka

10 REPLIES 10

Have you tried unchecking DataLoading box in the properties of grid?

Thanks for Reply.

I have done that but still it is blinking. I want to remove that.

Thanks & Regards,

Renuka

ankigupta
5-Regular Member
(To:rpatil-21)

There is property called ShowDataLoading in the Grid property. please uncheck that. Pravin is referring to same.

Thanks for Reply.

I have done that but still it is blinking. I want to remove that.

Thanks & Regards,

Renuka

qngo
5-Regular Member
(To:rpatil-21)

Hi, if you want that "The data should get loaded only when it is changed", you need something else than AutoRefresh. You can hide the loading bar but not the blink. The service "GetProperties" with the new property "Automatically updates when able" (from 7.2 apparently) would be helpful.

Related document: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS243895

Thanks for Reply.

Yes you are right. It has hidden the loading bar but not the blinking.

We are using older thingworx version (6.5.6) not the 7.2.

Could you please suggest any alternatives for Thingworx 6.5.6?

Thanks & Regards,

Renuka

qngo
5-Regular Member
(To:qngo)

So there's another way:

  • Create a flag (a Property) (1) that changes when the data changes and the mashup need to be updated/refreshed. It can be a Property of a Thing (for global effect) or a Session property (if the effect is different for different users). This flag is updated when the data changes or when a condition is satisfied. It can be a BOOLEAN or a DATETIME for exapmle.
  • A service (2) (result: BOOLEAN) in mashup that is called by widget AutoRefresh. This service will check the flag above and decide if it's necessary to refresh the Grid. If the flag is a BOOLEAN, the service can simply retrieve it. If the flag is a DATETIME, the service can check if the flag is older than 5 minutes from now, for example.
  • The result of the service above is bound to a parameter of a Validator widget (3) in the mashup. This widget evaluates the result of the service (2) above and call the service that is bound to the Grid widget to refresh it.

Another example of this procedure (not exactly the same): Refreshing the Repeater only if the data actually changed

as you want to load data on change you can subscribe that to a specific property and in the same subscription you call the desired service.

Could you please give any example?

Hi Renuka,

As i know will blink because the reason is the refresher you have applied to the service which is giving data to Grid. so the Grid is refreshing itself. as of now i dont know the reason to stop it but you can minimize it by increasing time interval of refresh widget.

Top Tags