Project

General

Profile

Updating tables

Added by Matt Russell almost 10 years ago

Our site has many data tables (WTableViews using QueryModels) that can be updated by other threads.

What is the best way to update these tables with new information?

Right now we run a WTimer to run model->reload() every 2 seconds. This generates a lot of requests, which is fine I suppose, but the red loading icon on the top right is annoying.

Is there any way, perhaps with WebSockets, to have the table update, without having the page poll every 2 seconds, or at least not show the loading icon?

Thanks


Replies (3)

RE: Updating tables - Added by Trigve Siver almost 10 years ago

Maybe you could use asio::deadline_timer with WServer::post()?

RE: Updating tables - Added by Koen Deforche almost 10 years ago

You can do this using server push (with or without websockets). Have a look at the examples/feature/serverpush and examples/feature/broadcast

RE: Updating tables - Added by Matt Russell almost 10 years ago

Will do, thanks!

    (1-3/3)