Virtualized
Optimize table performance by rendering only visible rows for large datasets.
Example
Id
FirstName
LastName
Age
Email
Country
Per page:
Page 1 of 0
Showing
0
to
0
of 0 rows
{#snippet header()}
{/snippet}
{#snippet vl_slot({ index, item })}
{#each datagrid.columns.getLeafColumnsInOrder() as column}
{@render LeafHeader(column)}
{/each}
{#if !item.isGroupRow()}
{#each datagrid.columns.getLeafColumnsInOrder() as column}
{@render RenderBodyCell(column, item)}
{/each}
{:else}{/if}
{/snippet}
{getCellContent(column, row.original)}
{/snippet}
{#snippet LeafHeader(column: LeafColumn)}
{#if column.isVisible()}
datagrid.handlers.sorting.toggleColumnSort(column, e.ctrlKey)}
class={cn(
'th flex min-w-40 max-w-40 items-center justify-between gap-2 px-4 py-2',
column._meta.grow && '!max-w-full !grow',
column.isSortable() && 'cursor-pointer'
)}
style:--width={column.state.size.width + 'px'}
style:--min-width={column.state.size.minWidth + 'px'}
style:--max-width={column.state.size.maxWidth + 'px'}
>
{/if}
{/snippet}
{column.header}
{#if column.isSortable()}
{/if}