Perspective - Table
Component Palette Icon:
Description
The Table component displays database data in tabular form. Properties enable you to customize the data content, style, navigation, and user interaction of your table.
User Interaction
Interaction | Description |
---|---|
Column Resizing | When configured through the designer via the corresponding column config, a column can be resized during runtime. The resize handle exists in a 36px swath centered on the end of the header cell. Hovering over this area will change the mouse cursor to column resizing. Dragging the resize handle will display a resize guide effectively providing a visual for the new column position as the user drags. These changes in width will not persist, and are merely for the convenience of the user. |
Sorting | When sorting is enabled on a column and the table head is enabled, a sort indicator will display to the right of the header cell content. The sort indicator will display the sort direction. New in 8.1.6 As of 8.1.6 the Table component now sorts columns based on the underlying data type in the column, instead of sorting alphanumerically as if all values were string formatted. |
Selection | When selection is enabled, a user may select table data based upon the table's selection configuration. In the browser, selection is indicated by a light blue overlay rendered on cells. The root selection, or most recently selected cell has a light blue border. The root selection corresponds with the selected column and selected row properties of the table component's selection configuration. |
Editing | When editing is enabled on an individual cell, a user can edit a cell by performing the interaction specified by the 'allow edit on' property of the table component. When in edit mode, an editing cell with the corresponding cells content will be presented for edit. To commit this edit, the user must press the return or enter key. To exit the edit, the user may either press the escape key or select another table cell. When an edit is committed, the edited data is sent to the cell edit component event of the Table component. New in 8.1.38 If an external source updates a cell value, which will cause either the selectedRow or selectedColumn property to change, the Table will page and scroll to the updated cell for increased visibility to Table edits. |
Paging | When paging is enabled, a user may use the provided buttons to navigate between available pages and also jump to a specific page within range. |
Filtering | When filtering is enabled, a user may filter all of the data, not just the data being displayed when pagers are enabled, of the table component. If paging also happens to be enabled, the table will automatically page jump if it becomes necessary so that it does not display an empty page. |
Coloring/Look | The table is made up of various subareas (rows, cells, etc). To aid with styling the component, these subareas have dedicated style objects that can be used to change the look. Furthermore, some parts of the table's property model allow for more fine tuned control of the look. For example, changing the color of all the rows on table can be accomplished by setting a background color on the rows.style object. However, if you wanted to alternate colors on each row, you could instead look towards the rows.striped.color object, which allows you to pick colors for even and odd rows separately. |
Properties
Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.
Name | Description | Property Type |
---|---|---|
data | Can be a dataset, an array of arrays, or an array of objects. The preferred (recommended) data is either a dataset or an array of objects. Individual data items can be a string, a number, or an object with reserved keys. Object data items must have a value property. Optionally they can also have properties to indicate the style for the object and whether it is editable.
| array |
virtualized | Enables virtualization of table rows, which is an optimization method that only shows a portion of the underlying data on the chart at a time.While enabled, the table will only be populated with a smaller subset of data: just the visible rows, and a few rows above and below. The idea being the component will be populated with new records as the user scrolls down the listing, assuming there are enough records to necessitate a scrollbar. Enabling virtualization generally results in a performance gain in the session, in cases where the data property is populated with a large amount of content, as the table will only have to "load" a small subset of content. The trade off is that the table will need to load records as the user scrolls, so scrolling quickly may not feel as "smooth" when compared to disabling virtualization. | value: boolean |
selection | When Selection is configured, a user will be able to select table data based upon the table's selection configuration. Similar to Vision module, you can select single, single interval, and multiple interval selection modes. The current selection and selection data is written back to the table components property tree. With the exception of the selection data property, the selection properties are bidirectional, meaning that if you were to change the value of the selected column property, it should be reflected in the table component. Click to see the selection properties. | object |
filter | Where Table filtering is configured, as well as the filtered data. Click to see the filter properties. | object |
enableHeader | When enabled, the table header is displayed including the main table header along with the Header Groups. Default is true. | value: boolean |
enableFooter | When selected, this enables the table footer, including the main table footer along with the Footer Groups. Default is false. | value: boolean |
enableHeaderGroups | Enable table header groups if available. Default is false. | value: boolean |
enableFooterGroups | Enable table footer groups if available. Default is false. | value: boolean |
headerGroups | Header Groups are additional headers that are displayed above the main table header. Each header group equates to a single row with individual cells containing title text. The headerGroups properties include:
| object |
footerGroups | Footer Groups are additional footers that display above the main table footer. Each footer group equates to a single row which consists of individual cells containing title text. The footerGroups properties include:
| object |
columns | The Columns property allows for granular column-by-column configurations, indicating how each column should be displayed in the table. Column configs enable the you to customize the table component's display and how users will be able to interact with the table in runtime. When a Column Config option is present, the table reflects that custom configuration. For examples on how column configurations work, see Table Column Configurations. You can add Column Config options by selecting Add Array Element under the Columns property. By default, the Table component displays all available data in columns, however choosing to customize column configuration will reset the table to a single column display. Columns will have to be manually added back into the table using the Add Array Element icon on the right of the Columns property.
| array |
dragOrderable | New in 8.1.14 When enabled, users may drag column headers to reorder columns in the table if Column Config options are present. | value: boolean |
sortOrder | The default weighted order in which columns and their contents are sorted relative to other columns and their contents. Used when the component loads. For sortOrder to be applied, the table must meet the following requirements:
| array |
rows | Configures all rows in the table component. Includes settings for expanding rows into subviews. Click to see the rows properties. | object |
cells | Configures all cells in the table component.
| object |
editingCell | New in 8.1.37 The current editing cell with two properties to display the column and row when actively editing. | |
nullFormat | New in 8.1.25 The table null format configuration used when a table contains either a "null" string value or blank cell data. Can be overridden by individual column nullFormat configuration.
| object |
pager | Enables table pagination. Pagination improves performance and appearance on large tables, over 1000 rows. Click to see the pager properties. | object |
resizeMode | Specifies whether the table resize mode is either Fill or Fixed. In Fill resized mode, the total width of all the columns cannot be less than the width of the table. In Fixed resized mode, the total width of all the columns can be less than the width of the table. | value: boolean |
style | Sets a style that applies to the component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
emptyMessage | Empty message configuration.
| object |
headerStyle | New in 8.1.11 Sets a style that applies to all column headers. Can be overridden by both columns.style and columns.header.style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
headerGroupStyle | New in 8.1.11 Sets a style that applies to all headerGroups. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
bodyStyle | New in 8.1.11 Sets a style that applies to the table body. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
footerStyle | New in 8.1.11 Sets a style that applies to all column footers. Can be overridden by both columns.style and columns.footer.style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
footerGroupStyle | New in 8.1.11 Sets a style that applies to all footerGroups. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
selection Properties
Name | Description | Property Type |
---|---|---|
mode | This option determines if only one row, cell, or column can be selected at once. Options are single, single interval, and multiple interval. | value: string |
enableRowSelection | This option is used in conjunction with the Column Selection allowed flag in order to determine whether whole rows, whole columns, or both (single cells) are selectable. Can be set to true or false. Default is true. | value: boolean |
enableColumnSelection | This option is used in conjunction with the Row Selection allowed flag in order to determine whether whole rows, whole columns, or both (single cells) are selectable . Can be set to true or false. Default is false. | value: boolean |
selectedColumn | The index of the first selected column, or null if none. | value: numeric |
selectedRow | The index of the first selected row, or null if none. | value: numeric |
data | An array of objects representing the current selection. | array |
style | New in 8.1.11 Sets a style that applies to the visual selection. This does not impact the highlight style when the mouse is hovered over the table. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
filter Properties
Name | Description | Property Type |
---|---|---|
enabled | Enables filtering. Default is false. | value: boolean |
text | Contains the text you want to filter on. | value: string |
results | The filtered data. | object |
style | New in 8.1.11 Sets a style that applies to the filter display. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
columns.filter Properties
Name | Description | Property Type |
---|---|---|
enabled | When true, will apply any valid column filters configured here. | boolean |
visible | Specifies how the filter icon in the column header is visible to the user. Unless "never", will always be shown if a mobile device is connected. | value: string dropdown |
string | String type column filter.
| object |
number | Number type column filter.
| object |
boolean | Boolean type column filter.
| object |
date | Date type column filter.
| object |
columns.progressBar Properties
Name | Description | Property Type |
---|---|---|
max | Progress bar maximum value. | value: numeric |
bar | Settings for the bar. | object |
track | Settings for the track. | object |
value | Settings for the value on the Progress Bar. | object |
rows Properties
Name | Description | Property Type |
---|---|---|
height | New in 8.1.6 A minimum height value applied to all rows. A row cannot be shorter than this value, but it can be taller based on the height of the content it displays. This property can be set to "auto" (the default value) or given a numerical value that will correspond to a minimum row height in pixels. | value: string / numeric |
subviewExpansionMode | Specifies how many subviews can be expanded at any given time. Options are multiple or single. Default is multiple. | value: string |
subview | When enabled, each table row can be expanded into a subview. The Expandable Arrow opens the subview. Content of the subview is determined by the View Path property. See the Displaying a Subview in a Table Row page for an example. | |
striped | Settings for setting the striping (alternating background color) to the rows of the table.
| object |
highlight | Highlight settings. | object |
style | Sets a style that applies to every row in the table. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
pager Properties
Name | Description | Property Type |
---|---|---|
options | Rows to show per pager option. | array |
initialOption | Initial option to use when the table first loads. Must exist as an available option. | value: numeric |
top | Enables top pager. The pager is a menu that displays the current page and Previous and Next icons for navigation. | value: boolean |
bottom | Enables bottom pager. The pager is a menu that displays the current page and Previous and Next icons for navigation. | value: boolean |
activePage | Represents the current active page and corresponds to the value of the page jump input field. | value: numeric |
style | New in 8.1.11 Sets a style that applies to the pager container. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
emptyMessage.noData Properties
Name | Description | Property Type |
---|---|---|
text | Text to display when there is no data source or the data source is empty. | value: string |
textStyle | Sets a style that applies to the text. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
icon | Settings for the icon to be displayed when there is no data source or the data source is empty. | |
bottom | Enables bottom pager. The pager is a menu that displays the current page and Previous and Next icons for navigation. | value: boolean |
activePage | Represents the current active page and corresponds to the value of the page jump input field. | value: numeric |
emptyMessage.noFilterResults Properties
Name | Description | Property Type |
---|---|---|
text | Text to display when a filter returns no results. | value: string |
textStyle | Sets a style that applies to the text. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class. | object |
icon | Settings for the icon to be displayed when a filter returns no results. | object |
Scripting
See the Perspective - Table Scripting page for the full list of scripting functions available for this component.
Examples
For examples of the Table component, see the following pages: