Skip to content

parseColumnShorthand

Since v0.7.0

Parse a column shorthand string into a React ColumnConfig.

Delegates parsing to @toolbox-web/grid core (issue #276). The result only ever carries field/header/type, so it satisfies React’s widened column type without a cast.

parseColumnShorthand(shorthand: string): ColumnConfig<TRow>
NameTypeDescription
shorthandstringThe shorthand string (e.g., ‘name’, ‘salary:number’)

ColumnConfig<TRow> - A ColumnConfig object

parseColumnShorthand('name') → { field: 'name', header: 'Name' }
parseColumnShorthand('salary:number') → { field: 'salary', header: 'Salary', type: 'number' }
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt