DataTable
Overview of the DataTable Component
The DataTable component consists of DataTableCols the number of which can be changed by adding or cloning.
Properties
Important Note!This document lists the properties that are specific to this particular UI component.
To check for the properties common for most UI components, please check the General components document.
The DataTable component has the following common properties:
Property Name | Property Description |
---|---|
Data Mode | Data source.
|
Rows | An array of rows to display (variable or mapping). |
Limit | Is necessary for calculating sizes (rows count) of the page and for pagination. |
Count | Enter the number to set the total count of all rows. The default is set to 0. |
Offset | The current offset ( page - 1 ) is shown. |
Selection Type | The type of row selection. The value types are
|
Display Check | Can be used to check whether you want to show the check box for a particular row based on some criteria.
|
External Sorting | To be used instead of client-side sorting. The default is set to False. |
Row Height | Is necessary for calculating the sizes of the page when infinite scrolling is used and it is optional for pagination mode.
|
Header Hight | Minimum header height in pixels.
|
Footer Height | The minimum footer height in pixels. This property is used for calculating the dimensions of the table size. |
Table Height | Set the height of a datatable in the percentage of viewport height. It means appending a special CSS class with needed styles. It will be changed to 100 % automatically when the Data Mode property is set to Client Infinite or Server Infinite or the ScrollbarV property is defined as True.
|
ScrollbarH | Enable/disable horizontal scrollbars. The default value is set to False. |
ScrollbarV | Is necessary for infinite scrolling. Setting the property to True resets the Row Height and Header Height properties from auto to undefined because there are required defined height values for correct table calculations. The default value is set to False. |
Column mode | Column modes allow having a variety of different ways to apply column width distribution to the columns using:
|
Theme | Set the default style of a datatable. It means appending a special CSS class of a predefined theme to the datatable element. The value types are Material (default), Dark, Bootstrap. |
Reordable | Enable/disable the ability to re-order columns by dragging them. Value type: boolean. The default value is set to True. |
Row Class | The function used to populate a row's CSS class. The function will take a row and return a string or object. The value type is Function.
|
Sorts | Used to determine the default column for sorting. The default is set to empty (unsorted).
|
Messages | Static messages in the table that can be overridden for localization.
|
Css Classes | Custom CSS classes that can be defined to override the icons classes for up/down in sorts and previous/next in the pager.
|
(select) | Action to be triggered when the component is selected. |
DataTableCol
To add a DataTableCol, click the + button on the DataTable.
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 decimalize it. |
Property | The property to bind the row values to. If undefined, it will camelcase the name value. |
Resizeable | The column can be resized manually by the user. The default is set to True. |
Can Auto Resize | Define whether the column can automatically resize to fill extra space. The default is set to True. |
Sortable | Sorting of the row values by this column. The default is set to True. |
Draggable | Define if the column can be dragged to re-order. The default is set to True. |
Checkboxable | Indicate whether the column should show a check box component for selection. Only applicable when the selection mode is Checkbox. |
Header Checkboxable | Indicate whether the column should show a check box component in the header cell. Only applicable when the 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 the Edit button to access the HTML editor. Angular TemplateRef allows authoring custom body cell templates. |
Header Template | Click the Edit button 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 API. It will any available extra width and distribute it proportionally according to all columns' flexGrow values. The default is set to 0. |
Cell Class | Cell classes to apply to the body cell. |
Header Class | Header CSS classes to apply to the header cell. |
Updated 7 days ago