State & Handle
Controlled sort/filter/pagination/selection, JSON state round-trip, imperative handle, and event callbacks.
Use DataTableInitialState for one-time setup and controlled props for parent-owned models.
- Parent components that own table state
- Save/restore user grid preferences
- Toolbar buttons that drive sort/filter/scroll imperatively
- Pass
sort,filter,pagination, andselectionsignals for controlled mode. - Wire
DataTableEventscallbacks to keep parent state in sync. - Capture
DataTableHandleviadata_table_events.on_handlefor imperative methods. - Call
export_state/restore_stateonDataTableStatefor persistence.
Controlled models
Parent-owned sort, filter, pagination, and selection with two-way sync via event callbacks.
Ada | Admin |
Grace | Editor |
Bob | Admin |
Carol | Admin |
Dan | Admin |
State export and restore
Capture the full table state as JSON, reset, and restore for round-trip persistence.
Ada | Admin |
Grace | Editor |
Programmatic handle
Imperative sort, filter, search, and scroll via DataTableHandle.
Row 0 | |
Row 1 | |
Row 2 | |
Row 3 | |
Row 4 | |
Row 5 | |
Row 6 | |
Row 7 | |
Row 8 | |
Row 9 | |
Row 10 | |
Row 11 | |
Row 12 | |
Row 13 | |
Row 14 | |
Row 15 | |
Row 16 | |
Row 17 | |
Row 18 | |
Row 19 | |
Row 20 | |
Row 21 | |
Row 22 | |
Row 23 | |
Row 24 | |
Row 25 | |
Row 26 | |
Row 27 | |
Row 28 | |
Row 29 |
Event callbacks
All DataTableEvents fire on real state changes; this preview logs each event.
Ada | Admin | |
Grace | Editor |