Data Den - API
Options
Name | Type | Default | Description |
---|---|---|---|
cssPrefix
|
string | "" |
An optional property that allows you to specify a CSS prefix for styling the data table. It's a string representing the CSS class prefix. |
mode
|
'client' | 'server' | 'client' |
An optional property that specifies the mode of DataDen, which can be either 'client' or 'server'. It determines whether data processing and filtering happen on the client side or server side. |
columns
|
DataDenColDef[] | A required property that defines an array of column definitions (DataDenColDef) for the data table. Each column definition includes information about the field, header name, sorting, filtering, resizing, width, and cell renderer for a column. | |
defaultColDef
|
DataDenDefaultColDef | An optional property that allows you to specify default column configuration options for all columns in the table. These options include sorting, filtering, resizing, width, and cell renderer. | |
rows
|
TData | An optional property that represents the data rows to be displayed in the table. The type TData is a generic type parameter that allows you to specify the data type for the rows. | |
draggable
|
boolean | false |
An optional property that indicates whether columns in the table can be dragged and reordered by the user. If set to true, users can rearrange column positions. |
pagination
|
boolean | false |
An optional property that determines whether pagination is enabled for the table. If set to true, pagination controls will be displayed, allowing users to navigate through multiple pages of data. |
paginationOptions
|
DataDenPaginationOptions | An optional property that allows you to specify pagination-related options, such as page size, page size options, and custom text for the pagination display. | |
quickFilterOptions
|
DataDenQuickFilterOptions | An optional property that provides options for configuring the quick filter, including debounce time and a custom filter function. | |
rowHeight
|
number | An optional property that allows you to specify the height of the rows in the table. It is a numeric value representing the row height in pixels. | |
headerHeight
|
number | An optional property that allows you to specify the height of the header in the table. It is a numeric value representing the header height in pixels. |
Column Options (DataDenColDef)
Property | Type | Description |
---|---|---|
field
|
string | The name of the field from the data source that should be displayed in this column. |
headerName
|
string | The text to be displayed as the column header. |
sort
|
boolean | Indicates whether sorting is enabled for this column. |
sortOptions
|
DataDenSortOptions | Options for configuring sorting behavior for this column. |
pinned
|
'left' | 'right' | Indicates whether the column should be pinned to the left or right. |
filter
|
boolean | Indicates whether filtering is enabled for this column. |
filterOptions
|
DataDenHeaderFilterOptions | Options for configuring the column header filter. |
resize
|
boolean | Indicates whether column resizing is enabled for this column. |
width
|
number | The width of the column. |
cellRenderer
|
Function | A function that returns an HTMLElement for custom rendering of cell contents.Default cellRenderer: DataDenDefaultCellRenderer, |
Header Filter Options (DataDenHeaderFilterOptions)
Property | Type | Description |
---|---|---|
method
|
'includes' (for text), 'equals' (for number, date, and select) | The filtering method to apply (e.g., 'includes' for text, 'equals' for number, date, and select). |
debounceTime
|
number | The debounce time (in milliseconds) for filtering data when the user interacts with the filter input. |
caseSensitive
|
boolean | For text filters, indicates whether the filter should be case-sensitive. |
dateParserFn
|
Function | For date filters, a function that parses the input value into a Date object. |
listOptions
|
{ label: string; value: any; }[] | For select filters, an array of list options to populate the select filter. |
Default Column Definition (DataDenDefaultColDef)
Property | Type | Description |
---|---|---|
sort
|
boolean | Indicates whether sorting is enabled for this column. |
sortOptions
|
DataDenSortOptions | Options for customizing column sorting behavior. |
filter
|
boolean | Indicates whether filtering is enabled for this column. |
filterRenderer
|
DataDenHeaderFilterOptions | A function that returns an HTMLElement for custom rendering of the column filter UI. |
filterOptions
|
DataDenHeaderFilterOptions | Options for customizing the header filter for this column. |
resize
|
boolean | Indicates whether column resizing is enabled for this column. |
width
|
number | The initial width of the column. |
cellRenderer
|
Function | A function that returns an HTMLElement for custom rendering of cell contents.Default cellRenderer: DataDenDefaultCellRenderer, |
Pagination Options (DataDenPaginationOptions)
Property | Type | Description |
---|---|---|
pageSize
|
number | The number of rows to display per page. |
ofText
|
string | The text to display between the current page number and the total number of pages (e.g., "of"). |
Quick Filter Options (DataDenQuickFilterOptions)
Property | Type | Description |
---|---|---|
filterFn
|
(searchTerm: any, value: any) => boolean | A custom filter function that determines whether a row should be displayed based on the search term and row value. |
Sort Options (DataDenSortOptions)
Property | Type | Description |
---|---|---|
comparator
|
(valueFirst: any, valueSecond: any) => number | A function that compares two values for sorting purposes. It should accept two values, 'valueFirst' and 'valueSecond', and return a number. If 'valueFirst' is less than 'valueSecond', the function should return a negative number. If they are equal, it should return 0. If 'valueFirst' is greater than 'valueSecond', it should return a positive number. Must implement the DataDenSortComparator interface. |
Header Filter Renderer (DataDenHeaderFilterRenderer)
Method/Property | Return Type | Description |
---|---|---|
getGui()
|
HTMLElement | Returns the HTML element representing the header filter UI. |
destroy()
|
void | Destroys any resources or components used by the header filter. |
getType()
|
string | Returns the type identifier of the header filter. |
getState()
|
any | Returns the current state/configuration of the header filter. |
isActive()
|
boolean | Checks if the header filter is currently active/engaged. |
getFilterFn()
|
(state: any, value: any) => boolean | Returns a filtering function based on the header filter's state. |