Usage
Signature:
interface GridHeaderItem<D>
Generic Parameters
Parameter Description D Type of Data
Typescript Import Format
//To use this interface, import as below.
import {GridHeaderItem} from "ojs/ojdatagridprovider";
For additional information visit:
Fields
-
data :D
-
The data property for the header returned to the DataGrid from DataGridProvider.
Data can be any type, however there are some recommendations.
If data is a primitive type, the default DataGrid renderer will be able to render that plain string/number/boolean. If data is complex type, the default DataGrid renderer will likely be unable to render the complex object in a meaningful way.
We recommend data be an object with any properties that your cell may need access to. Doing so will allow following the best editing practices and the best extensibility. In DataGrid demos you may find our samples show data is an object like
{data: string}
, but this is not required.- Since:
- 11.0.0
-
depth :number
-
The total number of indexes the header item being referenced spans along the opposite axis. Should be 1 for unmerged headers.
Use this property to indicate header merges across its opposite axis.
For example to make a row header span 2 column levels rather than one, return 2 for level.
- Since:
- 11.0.0
-
extent :number
-
The total number of indexes the header item being referenced spans along its own axis. Should be 1 for unmerged headers.
Use this property to indicate header merges across its own axis.
For example to make a row header span 2 rows rather than one, return 2 for extent.
Note the DataGrid requires a one to one mapping of innermost rows to indexes. This means that the headers closest to the databody along any given axis, must have extent 1.
- Since:
- 11.0.0
-
index :number
-
The absolute zero-based start index of the header item being referenced.
- Since:
- 11.0.0
-
level :number
-
The zero based absolute start index the header item being referenced along the opposite axis. Should be 0 for headers that are not nested.
For example if there were 2 columns of row headers, the outermost column of row headers would be level 0, and the innermost would be level 1.
- Since:
- 11.0.0
-
metadata :GridHeaderMetadata & {[propName:string]:any}
-
The metadata property for the header returned to the DataGrid from DataGridProvider.
Use metadata to specify header sortability and sort order in the grid.
Metadata is an object that can be empty or have any keys. It is provided as a way to specify additional information about the cell that applications can access from contextual information about the cell.
Metadata has optional keys the DataGrid can interpret for headers only today, see GridHeaderMetadata, but this may be extended in the future.
- Since:
- 11.0.0