kvision
kvision copied to clipboard
How to load page data in the background
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.
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: @.***>
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.