Usage
Signature:
interface CTableDisplayElement<K extends string | number,D,C extends string>
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CTableDisplayElement } from "oj-c/table-display";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/table-display";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Slots
JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
-
cellTemplate
-
Note: When the template is executed for each item, it will have access to the binding context containing the following properties: oj-c.TableDisplay.CellTemplateContext
The template for rendering each data cell in table-display. When a column.template is specified that will take precedence over this template. The slot content must be a template element. The content of the template should not include the td element, only its contents. The template has access to the context CellTemplateContext via $current or the aliased name for $current set via data-oj-as.Properties of $current:
Name Type Argument Description columnKeyC Column key dataD[keyof D] <optional>
Data for the cell, derived from the column.field property itemItem.<K, D> Row item containing data and metadata -
footerTemplate
-
Note: When the template is executed for each item, it will have access to the binding context containing the following properties: oj-c.TableDisplay.FooterTemplateContext
The template for rendering each footer cell in table-display. When a column.footerTemplate is specified that will take precedence over this template. The slot content must be a template element. The content of the template should not include the td element, only its contents. The template has access to the context FooterTemplateContext via $current or the aliased name for $current set via data-oj-as.Properties of $current:
Name Type Argument Description footerTextstring <optional>
Column footer text keyC Column key -
headerTemplate
-
Note: When the template is executed for each item, it will have access to the binding context containing the following properties: oj-c.TableDisplay.HeaderTemplateContext
The template for rendering each header cell in table-display. When a column.headerTemplate is specified that will take precedence over this template. The slot content must be a template element. The content of the template should not include the th element, only its contents. The template has access to the context HeaderTemplateContext via $current or the aliased name for $current set via data-oj-as. Useoj-c-sort-controlto provide sorting in a header.Properties of $current:
Name Type Argument Description headerTextstring <optional>
Column header text keyC Column key -
noData
-
The template for rendering content when table-display has an empty data set. The slot content must be a template element. If not specified then a default no data message will be displayed.
-
DynamicSlots.CellTemplateContext (Dynamic)
-
Context passed into the cell template specified in the
column.templateproperty.Note: For additional information see .
Properties of $current:
Name Type Argument Description columnKeyC Column key dataD[keyof D] <optional>
Data for the cell, derived from the column.field property itemItem.<K, D> Row item containing data and metadata -
DynamicSlots.FooterTemplateContext (Dynamic)
-
Context passed into the footer template specified in the
column.footerTemplateproperty.Note: For additional information see .
Properties of $current:
Name Type Argument Description footerTextstring <optional>
Column footer text keyC Column key -
DynamicSlots.HeaderTemplateContext (Dynamic)
-
Context passed into the header template specified in the
column.headerTemplateproperty.Note: For additional information see .
Properties of $current:
Name Type Argument Description headerTextstring <optional>
Column header text keyC Column key
Attributes
-
column-order :Array<C>
-
Controls the displayed columns and their order. An array of column keys that represents the displayed columns and the order to display them in. If not set, all columns will be displayed in the order returned by
Object.keys(columns).Names
Item Name Property columnOrderProperty change event columnOrderChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-column-order-changed -
column-widths :Record<C, number>
-
The desired widths of the specified table-display columns. A record mapping columns keys to numbers representing pixel widths for each column. Values should only be provided when a specific width is desired for a column as values provided will override table-display's normal column sizing calculations. Applications should avoid setting widths for every column in most cases as doing so will likely result in a non-responsive layout.
Names
Item Name Property columnWidthsProperty change event columnWidthsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-column-widths-changed -
columns :Record.<C, oj-c.TableDisplay.Column.<K, D>>
-
The set of columns that can be displayed in table-display. If no
columns-orderis specified, all columns specified will be displayed in the order returned byObject.keys(columns). Otherwise only the columns specified in thecolumns-ordervalue will be displayed.Names
Item Name Property columnsProperty change event columnsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-columns-changed -
data :DataProvider.<K, D>
-
The data provider for table-display.
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
horizontal-grid-visible :"enabled"|"disabled"
-
Controls the display of table-display horizontal gridlines.
- Default Value:
'enabled'
Supported Values:
Value Description enabledDisplay horizontal gridlines disabledDo not display horizontal gridlines Names
Item Name Property horizontalGridVisibleProperty change event horizontalGridVisibleChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-horizontal-grid-visible-changed -
layout :"contents"|"fixed"
-
The column sizing method used for table-display columns.
- Default Value:
'contents'
Supported Values:
Value Description contentsWhen specified, the initial column sizes are determined by the contents of the data. Does not require an overall width set on table-display. Can have performance issues when large numbers of columns and/or rows are initially rendered. fixedWhen specified, the initial column sizes are determined by column weights. Requires an overall width set on table-display (width='100%', width='200rem', etc.) Very performant when rendering large numbers of columns and/or rows. Names
Item Name Property layoutProperty change event layoutChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-layout-changed -
row :{ accessibleRowHeader?: C | Array<C> | ((context: oj-c.TableDisplay.RowContext<K, D>) => C | Array<C>); }
-
A subset of attributes for controlling certain behaviors on a per row basis.
Names
Item Name Property rowProperty change event rowChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-row-changed -
sort-criteria :Array<{ attribute: keyof D; sortDirection: 'ascending' | 'descending'; }>
-
Set of sort criteria representing the sort state of this Table's columns.
- Supports writeback:
true
Names
Item Name Property sortCriteriaProperty change event sortCriteriaChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-sort-criteria-changed -
vertical-grid-visible :"enabled"|"disabled"
-
Controls the display of table-display vertical gridlines.
- Default Value:
'disabled'
Supported Values:
Value Description enabledDisplay vertical gridlines disabledDo not display vertical gridlines Names
Item Name Property verticalGridVisibleProperty change event verticalGridVisibleChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-vertical-grid-visible-changed
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesobject An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void
Type Definitions
Exported Types
Note: Type definitions in this section are exported by the module, and so can be imported for use in application code.
-
RowContext<K,D>
-
Context used to specify a row in table-display.
Typescript Import Format
//To import this type, use the format below.
import { RowContext } from "oj-c/table-display";
Properties:
Name Type Description itemItem.<K, D> Row item containing data and metadata
Documentation-only Types
Note: Type definitions in this section have been provided for documentation purposes and cannot be imported into application code.
-
CellAlignment
-
Properties:
Name Type Argument horizontal"center" | "end" | "start" | "left" | "right" <optional>
vertical"center" | "top" | "bottom" <optional>
-
CellPadding
-
Specifies whether padding is enabled or disabled on specific sides of a cell.
Properties:
Name Type Argument Description bottom"disabled" | "enabled" <optional>
Specifies whether bottom padding is enabled or disabled. end"disabled" | "enabled" <optional>
Specifies whether end padding (right in ltr locales, left in rtl locales) is enabled or disabled. start"disabled" | "enabled" <optional>
Specifies whether start padding (left in ltr locales, right in rtl locales) is enabled or disabled. top"disabled" | "enabled" <optional>
Specifies whether top padding is enabled or disabled. -
CellTemplateContext<K,D,C>
-
Context passed into the cell template specified in the
column.templateproperty.Properties:
Name Type Argument Description columnKeyC Column key dataD[keyof D] <optional>
Data for the cell, derived from the column.field property itemItem.<K, D> Row item containing data and metadata -
Column<K,D>
-
Specifies the properties of a column.
Properties:
Name Type Argument Description alignmentoj-c.TableDisplay.CellAlignment <optional>
The alignment specified for data cells in this column. fieldkeyof D <optional>
Specifies the field attribute of the row item data that is mapped to the column. footerAlignmentoj-c.TableDisplay.CellAlignment <optional>
The alignment specified for the footer cell in this column. footerPadding"disabled" | "enabled" | oj-c.TableDisplay.CellPadding <optional>
Specifies padding for the footer cell in this column. Valid string values include 'enabled' and 'disabled'. Setting either 'enabled' or 'disabled' will apply to all sides of the footer cell, while providing an instance of CellPadding will only apply to the specified sides of the footer cell. footerTemplatestring <optional>
The name of the slot used to specify the template for rendering the footer cell in the column. The slot content must be a template element. The content of the template should not include the td element, only its contents. The template has access to the following context via $current or the aliased name for $current set via data-oj-as. footerTextstring <optional>
Text to display in the footer cell of the column headerAlignmentoj-c.TableDisplay.CellAlignment <optional>
The alignment specified for the header cell in this column. headerPadding"disabled" | "enabled" | oj-c.TableDisplay.CellPadding <optional>
Specifies padding for the header cell in this column. Valid string values include 'enabled' and 'disabled'. Setting either 'enabled' or 'disabled' will apply to all sides of the header cell, while providing an instance of CellPadding will only apply to the specified sides of the header cell. headerTemplatestring <optional>
The name of the slot used to specify the template for rendering the header cell in the column. The slot content must be a template element. The content of the template should not include the th element, only its contents. The template has access to the following context via $current or the aliased name for $current set via data-oj-as. headerTextstring <optional>
Text to display in the header cell of the column. horizontalAlignment"center" | "end" | "start" | "left" | "right" <optional>
The horizontal alignment of this column. maxWidthnumber <optional>
The maximum width in pixels of the column. This value is used during initial render, and does not affect the ability to resize the column. This value is applicable when either, layout='fixed' or layout='contents'. minWidthnumber <optional>
The minimum width in pixels of the column. This value is used during initial render, and does not affect the ability to resize the column. This value is applicable when either, layout='fixed' or layout='contents'. If not set and layout='fixed' a default minimum width will be determined by the theme. padding"disabled" | "enabled" | oj-c.TableDisplay.CellPadding | (context: oj-c.TableDisplay.RowContext<K, D>) => "disabled" | "enabled" | oj-c.TableDisplay.CellPadding <optional>
Specifies padding for the data cells in this column. Valid string values include 'enabled' and 'disabled'. Setting either 'enabled' or 'disabled' will apply to all sides of the data cells, while providing an instance of CellPadding will only apply to the specified sides of the data cells. sortable"disabled" | "enabled" <optional>
Enable or disable sorting along the column headers. sticky"disabled" | "enabled" <optional>
Whether this column should be prevented from scrolling out of view. templatestring <optional>
The name of the slot used to specify the template for rendering data cells in the column. The slot content must be a template element. The content of the template should not include the td element, only its contents. The template has access to the following context via $current or the aliased name for $current set via data-oj-as. weightnumber <optional>
Specifies the relative sizing weight of the column. If not set a default of 1 is assumed. This must be a positive number greater than or equal to 1. Its value does not affect the ability to resize the column. When table-display's layout attribute is set to fixed, this value is used to determine the relative width of the column compared to the other columns. For example, a column with a weight of 2 will have twice as much space allocated to it as a column with a weight of 1. This value has no effect when table-display's layout attribute is set tocontents. -
FooterTemplateContext<C>
-
Context passed into the footer template specified in the
column.footerTemplateproperty.Properties:
Name Type Argument Description footerTextstring <optional>
Column footer text keyC Column key -
HeaderTemplateContext<C>
-
Context passed into the header template specified in the
column.headerTemplateproperty.Properties:
Name Type Argument Description headerTextstring <optional>
Column header text keyC Column key