kvision icon indicating copy to clipboard operation
kvision copied to clipboard

How to load page data in the background

Open chavu opened this issue 2 years ago • 2 comments

I have a web page with a tabPannel that has 7 tabs. I'm loading 8 data collections displayed in tables on the tabs during page load, but it takes a lot of time to fully load the data from the server and the page is not responsive during that time. How can I make sure the data contintiues to load in the background while I can access other tabs which have loaded data.

chavu avatar Jul 19 '22 14:07 chavu

Hi,

Without more information about your goal. Coroutines is your friend here. You need to launch each data task within a coroutine and when finished enable the tab or show a mark to indicate that data is loaded.

Best regards,

Teo

On Tue, Jul 19, 2022, 09:00 Lenny Chavhunduka @.***> wrote:

I have a web page with a tabPannel that has 7 tabs. I'm loading 8 data collections displayed in tables on the tabs during page load, but it takes a lot of time to fully load the data from the server and the page is not responsive during that time. How can I make sure the data contintiues to load in the background while I can access other tabs which have loaded data.

— Reply to this email directly, view it on GitHub https://github.com/rjaros/kvision/issues/427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL5FHC7723GYZGXWJTMZ73VU2YHZANCNFSM54ADBQPQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tfonrouge avatar Jul 19 '22 16:07 tfonrouge

How do you load the data from the server? Almost all networking operations in JS are asynchronous, so there should be nothing blocking the page.

rjaros avatar Jul 19 '22 17:07 rjaros