āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/1771-technologies/lytenyte/(column)/column-field ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
LyteNyte Grid supports four types of values for field:
{ kind: "path"; path: string } to access nested
values. kind must be "path", and path must specify the lookup.field is optional. If omitted, LyteNyte Grid uses the column's id as
a fallback.
When field is a string, the grid uses it as a key to access the value
in object row data.
!demo:Key Lookup Fields="./demos/column-field-key"
If no field is set, the grid uses the column id. Because id must
be a string, this fallback behaves like a key lookup.
When field is a number, row data should be an array. The number acts
as the index for retrieving the value.
!demo:Number Index Fields="./demos/column-field-number-index"
Set field to a function for maximum flexibility. The function can
compute values using other columns.
!demo:Function Fields="./demos/column-field-function"
Set field to { kind: "path", path: string } to access nested object
values.
!demo:Path Fields="./demos/column-field-path-fields"
The path syntax matches Lodash's get:
{ kind: 1, path: "alpha.beta[0]" };
{ kind: 1, path: "beta[0].alpha" };
Prefer string or number fields for simplicity. Number fields are
compact and efficient. Function and path fields add complexity and may
prevent serialization of column definitions.
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā