Example 46: Tree Data with Lazy Loading
(from a Hierarchical Dataset -
Wiki)
code
{#if showSubTitle}
Lazy Loading only works with Hierarchical Tree Data, also when creating a Lazy Tree Data grid, you would typically assign the
data as the root collection but with empty children items.
However please note that Parents do require the children arrays to be defined but can be left as empty arrays (e.g.
chapters: [] in our example). Parents without empty children arrays defined will not be detected as parents.
Calling the "Expand All" command will only expand the nodes that were already lazily loaded (the other ones will remain as collapsed).
Aggregators will also be lazily calculated and aggregate only the data that it currently has loaded.
In the example below, clicking on the last "Chapter X" will demo an API call failure
{/if}
searchStringChanged((event.currentTarget as HTMLInputElement).value)}
/>