Class: Field
Description
Field definition for the field on the data item's type. The main purpose is to map that field to a Column.
Properties
Property | Type | Description |
---|---|---|
fieldName | string | The name of the field. This should be unique across all fields on the data grid. If valueGetter is not specified the field name is also assumed to be the property name of the desired value on the data item and is used to retrieve the value from the data item using a direct string index. |
valueGetter? | FieldValueGetter | An optional callback function to map how to retrieve and/or format the columns value from the data item. Using this callback will include any data modifications or formatting in sorting and filtering. Similar mapping and formatting could be done with the cell template slot (i.e. cell-${column.field.fieldName}) but those changes will not be included in any sorting or filtering. |
Constructors
new Field(fieldName, valueGetter)
new Field(fieldName, valueGetter?): Field
Parameters
Parameter | Type |
---|---|
fieldName | string |
valueGetter ? | FieldValueGetter |
Returns
Methods
resolveValue()
resolveValue(dataItem): any
Parameters
Parameter | Type |
---|---|
dataItem | any |
Returns
any