How To Control What search is run through Page Load

Hey, I’m losing my mind….

I built a single page app and as I moved forward the initial page load got dramatically slow + consuming memory.

I use multiple reusable elements and in the elements there are multiple repeating groups etc.

It seems from the browser logs that it basically runs almost all repeating group searches across the all reusables board even nothing is visible on the screen.

Generally what I can do to control what is actually searched through the page load?

Theoretically how could I do like zero search ran on page load? My goals is to lazy load objects when those are visible on screen so I have control over the load. And yes I prefer to stay on single page app.

Thanks

On each repeating group remove the default data source. Add a condition of ‘when this reusable element is viable’ and put the data source there. This makes the data load only when that reusable is visible. Make all elements controlling visibility not visible on page load and add condition to make visible based on a value like custom state or url parameter value.

2 Likes

Thanks.

To confirm

  1. Make the repeating group data load conditioned by it’s reusable’s visibility - literally go through all RG in all Reusables and add this condition
  2. Make the reusable not visible by default and turn on by url variable - go through each reusable placement across the app and make all of them not visible by default and find a url parameter for each placement to control by a url parameter

Can I triy to use a parameter on the reusable groups called “visible = y/n” and controlled it by URL? My thinking if I make it mandatory then it’ll just show the errors across the app and I can just go through that. Then I can make the repeating groups conditioned by that parameter. Feels easier to manege then the visibility of the reusable.

Thanks

Only on those that have a need

Not necessarily on the reusable element, but each instance (ie: each usage)

In my apps, I will place a group on a page called ‘invoices’ I have a reusable element that is my invoice feature set, which includes the list of invoices as well as CRUD operators. I put into my group on page called ‘invoices’ the reusable element, and I put onto the group the condition to be visible based on URL parameter.