createGrid
Create a new typed grid element programmatically.
This avoids the need to cast when creating grids in TypeScript:
// Before: manual cast requiredconst grid = document.createElement('tbw-grid') as DataGridElement<Employee>;
// After: fully typedconst grid = createGrid<Employee>({ columns: [{ field: 'name' }], plugins: [new SelectionPlugin()],});grid.rows = employees; // ✓ Typed!function createGrid(config: Partial<GridConfig<TRow>>): DataGridElement<TRow>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
config | Partial<GridConfig<TRow>> | Optional initial grid configuration |
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