Only showing a loader the first time a repeating group loads

So I have a repeating group that has load time when the user tabs on to that section. I would like to have a loading gif displayed while that RG is loading.

Simple enough. I have an image that is hidden with the gif, and show it when the RG is loading. That works fine. However, I have a few tabs with other RGs that have a similar logic. If they revisit a tab that was already loaded, it then creates a flash of the loader (since it is already loaded), which aesthetically is not good.

My initial idea was to create a custom state (yes/no) on the image that corresponded to each tab. that defaulted to no. When the user clicks on a tab, set a delay (based on approximate load time) and then set the custom state to yes. I can add to the conditional that the custom state has to be set to no to display the loading gif.

That works, but it doesn’t seem like the best way of solving this. Thoughts?

Make the image set to visible on page load no, then make a conditional for when to show the image…that conditional should be based on a custom state yes/no which is controlled by whether the rg was loaded or not…default of custom state would be no, which after the rg is loaded would be changed to yes.

This topic was automatically closed after 70 days. New replies are no longer allowed.