DataTable
Overview of the DataTable Component
DataTable Component
The DataTable component is composed of DataTableCol components, which can be added or cloned to adjust the number of columns as needed.
Properties
Important Note!This document lists the properties that are specific to this particular UI component.
To check for the properties common to most UI components, please refer to the General components document.
The DataTable component has the following properties:
Property Name | Property Description |
|---|---|
Data Mode | Specifies the data source configuration. Mode: Client Pages, Client Infinite, Server Pages, or Server Infinite. |
Rows | An array of rows to display (variable or mapping). There are two ways to set the data source for Rows: |
Limit | Required for calculating page sizes (row count) and pagination. |
Count | Sets the total count of all rows. Default: 0. This property is necessary for correct row display in infinite scroll modes and for page navigation calculations. |
Offset | Shows the current offset (page - 1). This property is necessary for calculating the current page number, which equals the Offset value plus 1. |
Selection Type | Defines the type of row selection:
|
Display Check | Used to conditionally show checkboxes for specific rows based on criteria. Create a new function under the DATA tab and select it for this property. |
External Sorting | Used instead of client-side sorting. Default: False. |
Row Height | Necessary for calculating page sizes when infinite scrolling is used; optional for pagination mode. Default values:
When infinite scrolling is not used, pass undefined for fluid heights. Note: Row Height cannot be auto when Data Mode is set to Client Infinite or Server Infinite, or when ScrollbarV is set to True. It automatically changes from auto to undefined when these conditions apply. |
Header Height | Minimum header height in pixels. Note: Header Height cannot be auto when ScrollbarV is True or Data Mode is Client Infinite or Server Infinite. It automatically changes from auto to undefined when these conditions apply. |
Footer Height | Minimum footer height in pixels. Used for calculating table size dimensions. |
Table Height | Sets the datatable height as a percentage of viewport height by applying a special CSS class. Options:
|
ScrollbarH | Enables/disables horizontal scrollbars. Default: False. |
ScrollbarV | Required for infinite scrolling. When set to True, resets Row Height and Header Height from auto to undefined because defined height values are required for correct table calculations. Default: False. |
Column Mode | Defines how column width distribution is applied:
|
Theme | Sets the default datatable style by applying a predefined theme CSS class. |
Reorderable | Enables/disables the ability to reorder columns by dragging. Value type: boolean. Default: True. |
Row Class | Function used to populate a row's CSS class. Takes a row and returns a string or object. Value type: Function. Enables adding custom classes based on specific conditions. |
Sorts | Determines the default column for sorting. Default: empty (unsorted).
|
Messages | Static table messages that can be overridden for localization:
|
CSS Classes | Custom CSS classes that override the default icon classes for sorting (up/down) and pager navigation (previous/next). Options:
|
(select) | Action triggered when the component is selected. |
DataTableCol
To add a DataTableCol, click the + button on the DataTable component.
The DataTableCol component has the following properties:
| Property Name | Property Description |
|---|---|
| Name | Column label. If none is specified, it will use the prop value and convert it to a readable format. |
| Property | The property to bind row values to. If undefined, it will convert the name value to camelCase. |
| Resizeable | Allows the column to be manually resized by the user. Default: True. |
| Can Auto Resize | Defines whether the column can automatically resize to fill extra space. Default: True. |
| Sortable | Enables sorting of row values by this column. Default: True. |
| Draggable | Defines if the column can be dragged to reorder. Default: True. |
| Checkboxable | Indicates whether the column should show a checkbox component for selection. Only applicable when selection mode is Checkbox. |
| Header Checkboxable | Indicates whether the column should show a checkbox component in the header cell. Only applicable when selection mode is Checkbox. |
| Frozen Left | Determines if the column is frozen to the left. |
| Frozen Right | Determines if the column is frozen to the right. |
| Cell Template | Click Edit to access the HTML editor. Angular TemplateRef allows authoring custom body cell templates. |
| Header Template | Click Edit to access the HTML editor. Angular TemplateRef allows authoring custom header cell templates. |
| Flex Grow | The grow factor relative to other columns. Same as the flex-grow CSS API. Takes any available extra width and distributes it proportionally according to all columns' flexGrow values. Default: 0. |
| Cell Class | CSS classes to apply to the body cell. |
| Header Class | CSS classes to apply to the header cell. |
Updated 19 days ago
