Lazy load models?

  • 2
  • Question
  • Updated 4 years ago
  • Answered
I have a tabset in which I lazy load all but the first tab, which is nice for performance. But I see through the console that the model data for those deferred tabs gets returned on the initial page load. Is there a way to only run a tab's model when the tab is displayed? My theory is that this should improve the initial page load even further.

Photo of Glenn Elliott

Glenn Elliott, Champion

  • 7,788 Points 5k badge 2x thumb

Posted 6 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 55,096 Points 50k badge 2x thumb
Official Response
As of the Skuid Banzai release, there will be a much easier way to "lazy load Models" by waiting until a user first navigates to a Tab --- there is a new Tab "Actions" property category where you can define sequences of Actions to run whenever a tab is shown, or just when a tab is first shown:

This is our recommended way to achieve the functionality requested in this post.