DataGridCustomEvent
Since v0.1.1
Custom event type for DataGrid events with typed detail payload.
Primarily useful when you need to declare handler parameters with
addEventListener. For most use cases, prefer grid.on()
which handles typing automatically.
type DataGridCustomEvent = CustomEvent<DataGridEventMap<TRow>[K]>Example
Section titled “Example”// Typed handler for addEventListenerfunction onCellClick(e: DataGridCustomEvent<'cell-click', Employee>): void { const { row, field, value } = e.detail; console.log(`Clicked ${field} = ${value} on ${row.name}`);}grid.addEventListener('cell-click', onCellClick);
// With grid.on() you don't need this type — it's inferred:grid.on('cell-click', ({ row, field, value }) => { console.log(`Clicked ${field} = ${value} on ${row.name}`);});See Also
Section titled “See Also”DataGridElement.onfor the recommended subscription APIDataGridEventMapfor all event typesDataGridEventDetailfor extracting detail type only
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt