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.
-
contextMenu
-
The contextMenu slot is set on the
oj-menuwithin this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.
To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc of the individual components for details.
Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.
Attributes
-
banding-interval :Object
-
Row banding and column banding intervals within the DataGrid body.
Names
Item Name Property bandingIntervalProperty change event bandingIntervalChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-banding-interval-changed -
banding-interval.column :number
-
Column banding intervals within the DataGrid body.
- Default Value:
0
Names
Item Name Property bandingInterval.column -
banding-interval.row :number
-
Row banding intervals within the DataGrid body.
- Default Value:
0
Names
Item Name Property bandingInterval.row -
cell :Object
-
The cell attribute contains a subset of attributes for databody cells.
Names
Item Name Property cellProperty change event cellChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-cell-changed -
(nullable) cell.class-name :((context: ojDataGrid.CellContext<K,D>) => string | void | null) | string | null
-
The CSS style class to apply to data body in the DataGrid. If a string is specified the class will be added to all data body cells. If a function is specified it takes a single parameter, cellContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property cell.className -
(nullable) cell.renderer :((context: ojDataGrid.CellContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
-
The renderer function that renders the content of the data body. See cellContext for information on the object passed into the cell renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the data body.
- undefined: If the developer chooses to append to the data body element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property cell.renderer - An Object with the following property:
-
(nullable) cell.style :((context: ojDataGrid.CellContext<K,D>) => string | void | null) | string | null
-
The inline style to apply to directly to cells in the data body. If a string is specified the class will be added to all data body cells. If a function is specified it takes a single parameter, cellContext and must return a string.
- Default Value:
null
Names
Item Name Property cell.style -
current-cell :(oj.ojDataGrid.CurrentCell.<K>|null)
-
The cell that currently have keyboard focus. Note that if the current cell is set to an item that is currently not available (not fetched in high-water mark scrolling case or inside a collapsed parent node) or invalid, then the value is not applied.
If the currentCell is a databody cell the object will contain the following information:
{type: 'cell', indexes: {row: rowIndexValue, column: columnIndexValue}, keys: {row: rowKeyValue, column: columnKeyValue}}If the currentCell is a header cell the object will contain the following information:
{type: 'header', axis:axisValue, index: indexValue, key: keyValue, level: levelValue}If the currentCell is a label cell the object will contain the following information:
{type: 'label', axis:axisValue, level: levelValue}If the currentCell is a label cell the object will contain the following information:
{type: 'label', axis:axisValue, level: levelValue}If setting the property to a databody cell, either indexes or keys must be specified, if both are specified indexes will be used as a hint. If setting the property to a header cell, axis and either "index and level" or "key" must be specified, if both are specified "index and level" will be used as a hint. If level is not specified it will default to 0.
- Default Value:
null
- Supports writeback:
true
Names
Item Name Property currentCellProperty change event currentCellChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-current-cell-changed -
data :(oj.DataGridDataSource|oj.DataProvider|null) data :(oj.DataProvider.<K, D>|null)
-
The data source for the DataGrid must be an extension of oj.DataGridDataSource or oj.DataProvider. See the data section in the introduction for data sources provided out of the box. If the data attribute is not specified, an empty DataGrid is displayed. If using a DataProvider with scrollPolicy scroll, the oj.DataProvider must support fetchByOffset capability as randomAccess.
Type details
Setter Type (oj.DataProvider.<K, D>|null) Getter Type oj.DataProvider.<K, D> - Default Value:
null
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-changeddnd :Object
Enables or disables drag and drop features on the datagrid.
Names
Item Name Property dndProperty change event dndChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-dnd-changeddnd.reorder :Object
Enables or disables reordering the rows within the same DataGrid using drag and drop.
Names
Item Name Property dnd.reorderdnd.reorder.row :"enable"|"disable"
Enables or disables reordering the rows within the same DataGrid using drag and drop. There must be move capability support on the data source to enable this feature.
- Default Value:
"disable"
Supported Values:
Value Description "disable"disable row reordering "enable"enable row reordering Names
Item Name Property dnd.reorder.rowedit-mode :"none"|"cellNavigation"|"cellEdit"
Determine if the DataGrid is read-only or editable.
Use
noneif the DataGrid is strictly read-only.The DataGrid
editModeis designed to support fast editing and requires that the input controls render fast and near synchronously to be stamped inside an editable cell. The DataGrid supports overwrite behavior for all of JET's input components. Custom components that render synchronously or components that only render asynchronously due to Promises that resolve immediately will also be stampable. The modules for the stamped component loaded/required when the DataGrid is loaded/required. Components that must go back to a server to render are not supported.Use
cellNavigationto allow editable cells, but the DataGrid is currently read-only and a single tab stop on the page. Pressing F2 or double click while in this mode will switch the DataGrid tocellEditmode.Use
cellEditto allow editable cells, and tab navigates to the next cell behavior. Pressing ESC while in this mode will switch the DataGrid tocellNavigationmode.- Default Value:
'none'
- Supports writeback:
true
Supported Values:
Value Description "cellEdit"the DataGrid cells are individually tabbable and editable "cellNavigation"the DataGrid is a single tab stop and editable at the cell level, but currently read-only "none"the DataGrid is read-only Names
Item Name Property editModeProperty change event editModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-edit-mode-changedgridlines :Object
Display or hide the horizontal or vertical gridlines in the data body. Gridlines are visible by default and must be set to
'hidden'in order to be hidden.Names
Item Name Property gridlinesProperty change event gridlinesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-gridlines-changedgridlines.horizontal :"visible"|"hidden"
Display or hide the horizontal gridlines in the data body. Gridlines are visible by default and must be set to
'hidden'in order to be hidden.- Default Value:
"visible"
Supported Values:
Value Description "hidden"hide horizontal gridlines "visible"show horizontal gridlines Names
Item Name Property gridlines.horizontalgridlines.vertical :"visible"|"hidden"
Display or hide the vertical gridlines in the data body. Gridlines are visible by default and must be set to
'hidden'in order to be hidden.- Default Value:
"visible"
Supported Values:
Value Description "hidden"hide vertical gridlines "visible"show vertical gridlines Names
Item Name Property gridlines.verticalheader :Object
The header attribute contains a subset of attributes for row and column headers.Names
Item Name Property headerProperty change event headerChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-header-changedheader.column :Object
The header column attribute contains a subset of attributes for column headers.Names
Item Name Property header.column(nullable) header.column.class-name :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to column headers in the DataGrid. If a string is specified the class will be added to all column header cells. If a function is specified it takes a single parameter, headerContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.column.classNameheader.column.label :Object
The header column label attribute contains a subset of attributes for column header labels. In order for labels to be rendered they must be provided by the datasource header set. In addition the grid structure must be such that allots space for the appropriate label.Names
Item Name Property header.column.label(nullable) header.column.label.class-name :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to column header labels in the DataGrid. If a string is specified the class will be added to all column labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.column.label.className(nullable) header.column.label.renderer :((context: ojDataGrid.LabelContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the column header label. See labelContext for information on the object passed into the column header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the column header label.
- undefined: If the developer chooses to append to the column header label element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.column.label.renderer(nullable) header.column.label.style :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The inline style to apply to column header labels in the DataGrid. If a string is specified the style will be added to all column labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as an inline style.
- Default Value:
null
Names
Item Name Property header.column.label.style(nullable) header.column.renderer :((context: ojDataGrid.HeaderContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the column header. See headerContext for information on the object passed into the column header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the column header.
- undefined: If the developer chooses to append to the column header element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.column.rendererheader.column.resizable :Object
Enable or disable width or height resizing along the column headers. Note that for column header, a function cannot be used with the
heightsubproperty. If a function is specified it takes a single parameter, headerContext and must return a string ofenableordisable.Names
Item Name Property header.column.resizableheader.column.resizable.height :"enable"|"disable"
Enable or disable height resizing along the column headers.
- Default Value:
"disable"
Supported Values:
Value Description "disable"disable height resizing on column headers "enable"enable height resizing on column headers Names
Item Name Property header.column.resizable.height(nullable) header.column.resizable.width :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable width resizing along the column headers. If a function is specified it takes a single parameter, headerContext and must return a string of
enableordisable.- Default Value:
"disable"
Supported Values:
Value Description "disable"disable width resizing on column headers "enable"enable width resizing on column headers Names
Item Name Property header.column.resizable.width(nullable) header.column.sortable :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable sorting on the field bounded by this header. The data source associated with the DataGrid must have the sort function defined and the capability supported. If a function is specified it takes a single parameter, headerContext and must return a string of
auto,enable, ordisable.- Default Value:
'auto'
Supported Values:
Value Description "auto"get the sortable property from the data source "disable"disable sorting on column headers "enable"enable sorting on column headers Names
Item Name Property header.column.sortable(nullable) header.column.style :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The inline style to apply to column headers in the DataGrid. If a string is specified the class will be added to all column header cells. Note that percentage (%) width and height values are not supported. If a function is specified it takes a single parameter, headerContext and must return a string.
- Default Value:
null
Names
Item Name Property header.column.styleheader.column-end :Object
The header columnEnd attribute contains a subset of attributes for column end headers.Names
Item Name Property header.columnEnd(nullable) header.column-end.class-name :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to columnEnd headers in the DataGrid. If a string is specified the class will be added to all columnEnd header cells. If a function is specified it takes a single parameter, headerContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.columnEnd.classNameheader.column-end.label :Object
The header columnEnd label attribute contains a subset of attributes for column end header labels. In order for labels to be rendered they must be provided by the datasource header set. In addition the grid structure must be such that allots space for the appropriate label.Names
Item Name Property header.columnEnd.label(nullable) header.column-end.label.class-name :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to columnEnd header labels in the DataGrid. If a string is specified the class will be added to all columnEnd labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.columnEnd.label.className(nullable) header.column-end.label.renderer :((context: ojDataGrid.LabelContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the columnEnd header label. See labelContext for information on the object passed into the columnEnd header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the columnEnd header label.
- undefined: If the developer chooses to append to the columnEnd header label element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.columnEnd.label.renderer(nullable) header.column-end.label.style :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The inline style to apply to columnEnd header labels in the DataGrid. If a string is specified the style will be added to all columnEnd labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as an inline style.
- Default Value:
null
Names
Item Name Property header.columnEnd.label.style(nullable) header.column-end.renderer :((context: ojDataGrid.HeaderContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the columnEnd header. See headerContext for information on the object passed into the columnEnd header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the columnEnd header.
- undefined: If the developer chooses to append to the columnEnd header element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.columnEnd.rendererheader.column-end.resizable :Object
Enable or disable width or height resizing along the columnEnd headers. Note that for columnEnd header, a function cannot be used with the
heightsubproperty. If a function is specified it takes a single parameter, headerContext and must return a string ofenableordisable.Names
Item Name Property header.columnEnd.resizableheader.column-end.resizable.height :"enable"|"disable"
Enable or disable height resizing along the columnEnd headers.
- Default Value:
"disable"
Supported Values:
Value Description "disable"disable height resizing on columnEnd headers "enable"enable height resizing on columnEnd headers Names
Item Name Property header.columnEnd.resizable.height(nullable) header.column-end.resizable.width :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable width resizing along the columnEnd headers. If a function is specified it takes a single parameter, headerContext and must return a string of
enableordisable.- Default Value:
"disable"
Supported Values:
Value Description "disable"disable width resizing on columnEnd headers "enable"enable width resizing on columnEnd headers Names
Item Name Property header.columnEnd.resizable.width(nullable) header.column-end.style :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The inline style to apply to columnEnd headers in the DataGrid. If a string is specified the class will be added to all columnEnd header cells. Note that percentage (%) width and height values are not supported. If a function is specified it takes a single parameter, headerContext and must return a string.
- Default Value:
null
Names
Item Name Property header.columnEnd.styleheader.row :Object
The header row attribute contains a subset of attributes for row headers.Names
Item Name Property header.row(nullable) header.row.class-name :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to row headers in the DataGrid. If a string is specified the class will be added to all row header cells. If a function is specified it takes a single parameter, headerContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.row.classNameheader.row.label :Object
The header row label attribute contains a subset of attributes for row header labels. In order for labels to be rendered they must be provided by the datasource header set. In addition the grid structure must be such that allots space for the appropriate label.Names
Item Name Property header.row.label(nullable) header.row.label.class-name :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to row header labels in the DataGrid. If a string is specified the class will be added to all row labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.row.label.className(nullable) header.row.label.renderer :((context: ojDataGrid.LabelContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the row header label. See labelContext for information on the object passed into the row header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the row header label.
- undefined: If the developer chooses to append to the row header label element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.row.label.renderer(nullable) header.row.label.style :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The inline style to apply to row header labels in the DataGrid. If a string is specified the style will be added to all row labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as an inline style.
- Default Value:
null
Names
Item Name Property header.row.label.style(nullable) header.row.renderer :((context: ojDataGrid.HeaderContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the row header. See headerContext for information on the object passed into the row header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the row header.
- undefined: If the developer chooses to append to the row header element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.row.rendererheader.row.resizable :Object
Enable or disable width or height resizing along the row headers. Note that for row header, a function cannot be used with the
widthsubproperty. If a function is specified it takes a single parameter, headerContext and must return a string ofenableordisable.Names
Item Name Property header.row.resizable(nullable) header.row.resizable.height :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable height resizing along the row headers. If a function is specified it takes a single parameter, headerContext and must return a string of
enableordisable.- Default Value:
"disable"
Supported Values:
Value Description "disable"disable height resizing on row headers "enable"enable height resizing on row headers Names
Item Name Property header.row.resizable.heightheader.row.resizable.width :"enable"|"disable"
Enable or disable width resizing along the row headers.
- Default Value:
"disable"
Supported Values:
Value Description "disable"disable width resizing on row headers "enable"enable width resizing on row headers Names
Item Name Property header.row.resizable.width(nullable) header.row.sortable :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable sorting on the field bounded by this header. The data source associated with the DataGrid must have the sort function defined and the capability supported. If a function is specified it takes a single parameter, headerContext and must return a string of
auto,enable, ordisable.- Default Value:
'auto'
Supported Values:
Value Description "auto"get the sortable property from the data source "disable"disable sorting on row headers "enable"enable sorting on row headers Names
Item Name Property header.row.sortable(nullable) header.row.style :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The inline style to apply to row headers in the DataGrid. If a string is specified the class will be added to all row header cells. Note that percentage (%) width and height values are not supported. If a function is specified it takes a single parameter, headerContext and must return a string.
- Default Value:
null
Names
Item Name Property header.row.styleheader.row-end :Object
The header rowEnd attribute contains a subset of attributes for row end headers.Names
Item Name Property header.rowEnd(nullable) header.row-end.class-name :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to rowEnd headers in the DataGrid. If a string is specified the class will be added to all rowEnd header cells. If a function is specified it takes a single parameter, headerContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.rowEnd.classNameheader.row-end.label :Object
The header rowEnd label attribute contains a subset of attributes for rowEnd header labels. In order for labels to be rendered they must be provided by the datasource header set. In addition the grid structure must be such that allots space for the appropriate label.Names
Item Name Property header.rowEnd.label(nullable) header.row-end.label.class-name :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The CSS style class to apply to rowEnd header labels in the DataGrid. If a string is specified the class will be added to all rowEnd labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as a className.
- Default Value:
null
Names
Item Name Property header.rowEnd.label.className(nullable) header.row-end.label.renderer :((context: ojDataGrid.LabelContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the rowEnd header label. See labelContext for information on the object passed into the rowEnd header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the rowEnd header label.
- undefined: If the developer chooses to append to the rowEnd header label element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.rowEnd.label.renderer(nullable) header.row-end.label.style :((context: ojDataGrid.LabelContext<K,D>) => string | void | null) | string | null
The inline style to apply to rowEnd header labels in the DataGrid. If a string is specified the style will be added to all rowEnd labels. If a function is specified it takes a single parameter, labelContext and must return a string to be set as an inline style.
- Default Value:
null
Names
Item Name Property header.rowEnd.label.style(nullable) header.row-end.renderer :((context: ojDataGrid.HeaderContext<K,D>) => {insert: HTMLElement | string} | void | null) | null
The renderer function that renders the content of the rowEnd header. See headerContext for information on the object passed into the rowEnd header renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the rowEnd header.
- undefined: If the developer chooses to append to the rowEnd header element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property header.rowEnd.rendererheader.row-end.resizable :Object
Enable or disable width or height resizing along the rowEnd headers. Note that for rowEnd header, a function cannot be used with the
widthsubproperty. If a function is specified it takes a single parameter, headerContext and must return a string ofenableordisable.Names
Item Name Property header.rowEnd.resizable(nullable) header.row-end.resizable.height :((context: ojDataGrid.HeaderContext<K,D>) => string ) | string | null
Enable or disable height resizing along the rowEnd headers. If a function is specified it takes a single parameter, headerContext and must return a string of
enableordisable.- Default Value:
"disable"
Supported Values:
Value Description "disable"disable height resizing on rowEnd headers "enable"enable height resizing on rowEnd headers Names
Item Name Property header.rowEnd.resizable.heightheader.row-end.resizable.width :"enable"|"disable"
Enable or disable width resizing along the rowEnd headers.
- Default Value:
"disable"
Supported Values:
Value Description "disable"disable width resizing on rowEnd headers "enable"enable width resizing on rowEnd headers Names
Item Name Property header.rowEnd.resizable.width(nullable) header.row-end.style :((context: ojDataGrid.HeaderContext<K,D>) => string | void | null) | string | null
The inline style to apply to rowEnd headers in the DataGrid. If a string is specified the class will be added to all rowEnd header cells. Note that percentage (%) width and height values are not supported. If a function is specified it takes a single parameter, headerContext and must return a string.
- Default Value:
null
Names
Item Name Property header.rowEnd.stylescroll-policy :"auto"|"loadMoreOnScroll"|"scroll"
Specifies the mechanism used to scroll the data inside the DataGrid.
- Default Value:
'auto'
Supported Values:
Value Description "auto"the DataGrid will decide the scroll policy "loadMoreOnScroll"additional data are fetched when the user scrolls to the bottom of the DataGrid and all previous data are kept in the DOM.
If you are using Paging Control with the DataGrid, please note that "loadMoreOnScroll" scroll-policy is not compatible with Paging Control "loadMore" mode."scroll"virtual scrolling is used meaning only rows/columns visible in the viewport are fetched and kept in the DOM Names
Item Name Property scrollPolicyProperty change event scrollPolicyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-scroll-policy-changedscroll-policy-options :Object|null
The following options are supported:
- maxRowCount: Maximum rows which will be displayed before fetching more will be stopped. Only applies when scrollPolicy is 'loadMoreOnScroll'.
- maxColumnCount: Maximum columns which will be displayed before fetching more will be stopped. Only applies when scrollPolicy is 'loadMoreOnScroll'.
Names
Item Name Property scrollPolicyOptionsProperty change event scrollPolicyOptionsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-scroll-policy-options-changedscroll-policy-options.max-column-count :number
The maximum number of columns which will be displayed before fetching more rows will be stopped.See the scroll-policy-options attribute for usage examples.
- Default Value:
500
Names
Item Name Property scrollPolicyOptions.maxColumnCountscroll-policy-options.max-row-count :number
The maximum number of rows which will be displayed before fetching more rows will be stopped.See the scroll-policy-options attribute for usage examples.
- Default Value:
500
Names
Item Name Property scrollPolicyOptions.maxRowCountscroll-position :Object
The information about the data grid scroll position. Contains the x,y pixel coordinates, as well as the index and key information of the cell closest to the origin of the grid data body.
The default value contains just the x,y pixel values specified. Once data is fetched the index and key sub-properties will be added. If there is no data the index and key sub-properties will not be available.
When setting the scrollPosition property applications can change any combination of the sub-properties. If multiple sub-properties are set at once they will be used in key, index, pixel order where the latter can serve as hints. If upon scrolling to the key the pixel position is within the cell the adjustment will be made to scroll to that pixel location. If a sparse object is set the other sub-properties will be populated and updated once the grid has scrolled to that position.
If the scrollPolicy is 'loadMoreOnScroll' and the scrollPosition is set to something outside of the currently rendered region, the grid will attempt to fetch until the specified scroll position is satisfied. If scrollPosition pixels are set out of the maximum visible bounds once all cells have been rendered or the indexes are set out of the data source bounds once all data has been fetched, the scroll position will be set at its maximum value along that axis.
If only setting scrollPosition using the keys sub-property to something outside of the currently rendered region, the grid will only scroll to that position if the keys are present in the data source.
Note that a scrollPosition set on the grid may be changed if the set value cannot be displayed the origin of the grid. For example if you scroll to the last row index, it will likely be updated to an index before that which corresponds to the row index at the origin, rather than the last row index which is at the bottom of the visible region.
Lastly, when a re-rendered is triggered by a datasource refresh event, or if the value for data attribute has changed, then the scrollPosition will be adjusted such that the selection anchor (typically the last item selected by the user) prior to refresh will appear at the origin of the viewport after refresh. If selection is disabled or if there is no selected cells, then the scrollPosition will go to the origin.
- Default Value:
{"x": 0, "y": 0}
- Supports writeback:
true
Properties:
Name Type Argument Description xnumber <optional>
the horizontal position in pixel ynumber <optional>
the vertical position in pixel rowIndexnumber <optional>
the zero-based row index of the cell at the origin of the grid. If scrollPolicy is set to 'loadMoreOnScroll' and the index is greater than maxCount set in scrollPolicyOptions, then it will scroll and fetch until the end of the list is reached and there's no more items to fetch. columnIndexnumber <optional>
the zero-based column index of the cell at the origin of the grid. If scrollPolicy is set to 'loadMoreOnScroll' and the index is greater than maxCount set in scrollPolicyOptions, then it will scroll and fetch until the end of the list is reached and there's no more items to fetch. rowKeyK <optional>
the row key of the cell at the origin of the grid. If DataGridDataSource is used for data and the key does not exist in the DataGridDataSource, then the value is ignored. If it is unknown in the data source then the grid will fetch and scroll until the item is found or the end of the axis is reached and there's no more items to fetch. columnKeyK <optional>
the column key of the cell at the origin of the grid. If DataGridDataSource is used for data and the key does not exist in the DataGridDataSource, then the value is ignored. If it is unknown in the data source then the grid will fetch and scroll until the item is found or the end of the axis is reached and there's no more items to fetch. offsetXnumber <optional>
the horizontal offset in pixel relative to the cell identified by key/index. offsetYnumber <optional>
the vertical offset in pixel relative to the cell identified by key/index. Names
Item Name Property scrollPositionProperty change event scrollPositionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-scroll-position-changedselection :Array.<oj.ojDataGrid.Selection.<K>>
Specifies the current selections in the DataGrid. Returns an array of range objects, or an empty array if there's no selection.
Cell Selection Range Objects: The cell selection range object contains subproperties: startIndex and startKey referring to the cell in the selection closest to the origin of the grid. endIndex and endKey referring to the cell in the selection furthest from the origin of the grid. All four subproperties will be objects with row and column subproperties themselves. Single cell selection would always have the same startIndex/endIndex and startKey/endKey. Example: cell selection for cell (1,2) to cell (3,4) [{startIndex: {row: 1, column: 2}, endIndex: {row: 3, column: 4}, startKey: {row: "r1", column: "c2"}, endKey: {row: "r3", column: "c4"}}]
Row Selection Range Objects: The row selection range object contains subproperty objects: startIndex and startKey referring to the row in the selection closest to the origin of the grid. endIndex and endKey referring to the row in the selection furthest from the origin of the grid. All four subproperties will be objects with only row as a subproperty themselves. Single row selection would always have the same startIndex/endIndex and startKey/endKey. Example: row selection for selecting row 1 to row 2 [{startIndex: {row: 1}, endIndex: {row: 2}, startKey: {row: "r1"}, endKey: {row: "r2"}}]
Entire Row/Column Selection in Cell Selection Mode: In the case of an entire row or column selection: The startIndex subproperty along that axis will be set to 0. The endIndex subproperty along that axis will be set to -1, regardless of if the endIndex is known. The endKey subproperty along that axis will be set to null, regardless of if the endKey is known. Example: Cell selection spanning column 1 to column 2 [{startIndex: {row: 0, column: 1}, endIndex: {row: -1, column: 2}, startKey: {row: "r0", column: "c1"}, endKey: {row: null, column: "c2"}}]
Select All: The startIndex subproperty values will be set to 0. The endIndex subproperty values will be set to -1, regardless of if the endIndex is known. Keys are set to null to remain consistent with row and column selections and to prevent misinterpretation of the selection range. Select All will cover all the data in the data source including that which is not displayed in the viewport. A select all type selection will now allow for deselections. Any range ending in -1 is unbounded. Example: [{startIndex: {row: 0, column: 0}, endIndex: {row: -1, column: -1}, startKey: {row: "r0", column: "c0"}, endKey: {row: null, column: null}]
Discontiguous Selection Ranges: In the case of multiple discontiguous selections, each individual selection will be one entry in the selection range array. Selection ranges may overlap with each other. Example: (1,2) to (3,4), and (5,6) to (7,8) would look like [{startIndex: {row: 1, column: 2}, endIndex: {row: 3, column: 4}, startKey: {row: "r1", column: "c2"}, endKey: {row: "r3", column: "c4"}}, {startIndex: {row: 5, column: 6}, endIndex: {row: 7, column: 8}, startKey: {row: "r5", column: "c6"}, endKey: {row: "r7", column: "c8"}}]
Setting the selection: The selection can be set using any combination of startIndex/startKey and endIndex/endKey. If a sparse object is set the DataGrid will fill in the unspecifed portions of the object, if the cells are in the viewport. If they are not the DataGrid will attempt to ask the data source for the missing index or key. In the case of datasource unable to provide a key or index, the key or index will be marked with undefined values. If Datagrid lacks the appropriate data to create the selection, it will not create a selection and remove the invalid selection object. If the selection is set out of the scope of the currently displayed data the DataGrid will not change the selection object. As items within the selected range are scrolled into view they will be displayed as selected.
- Default Value:
[]
- Supports writeback:
true
Names
Item Name Property selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changedselection-mode :Object
Specifies whether row or cell selections can be made, and the cardinality of each (single/multiple/none) selection in the DataGrid.
Only one of the attributes, row or cell, should not be
noneat a time. If both are notnonethen an error will be thrown.Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changedselection-mode.cell :"none"|"single"|"multiple"
The type of cell selection behavior that is enabled on the DataGrid. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
singleormultipleis specified, selection gestures will be enabled, and the DataGrid's selection styling will be applied to all cells specified by the selection attribute. Ifnoneis specified, selection gestures will be disabled, and the DataGrid's selection styling will not be applied to any cells specified by the selection attribute.Changing the value of this attribute will not affect the value of the selection attribute.
Only one of the
selectionModeattributes, row or cell, should not benoneat a time. If both are notnonethen an error will be thrown.- Default Value:
'none'
Supported Values:
Value Description "multiple"Multiple cells can be selected at the same time. "none"Selection is disabled. "single"Only a single cell can be selected at a time. Names
Item Name Property selectionMode.cellselection-mode.row :"none"|"single"|"multiple"
The type of row selection behavior that is enabled on the DataGrid. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
singleormultipleis specified, selection gestures will be enabled, and the DataGrid's selection styling will be applied to all rows specified by the selection attribute. Ifnoneis specified, selection gestures will be disabled, and the DataGrid's selection styling will not be applied to any rows specified by the selection attribute.Changing the value of this attribute will not affect the value of the selection attribute.
Only one of the
selectionModeattributes, row or cell, should not benoneat a time. If both are notnonethen an error will be thrown.- Default Value:
'none'
Supported Values:
Value Description "multiple"Multiple rows can be selected at the same time. "none"Selection is disabled. "single"Only a single row can be selected at a time. Names
Item Name Property selectionMode.rowtranslations :object|null
A collection of translated resources from the translation bundle, or
nullif this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.If the component does not contain any translatable resource, the default value of this attribute will be
null. If not, an object containing all resources relevant to the component.If this component has translations, their documentation immediately follows this doc entry.
Names
Item Name Property translationsProperty change event translationsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changedtranslations.accessible-actionable-mode :string
Provides properties to customize the accessible context to enter actionable mode.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleActionableModetranslations.accessible-column-context :string
Provides properties to customize the accessible context for the column index.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleColumnContexttranslations.accessible-column-end-header-context :string
Provides properties to customize the accessible context for the column end header index.
See the translations attribute for usage examples.
- Since:
- 2.1.0
Names
Item Name Property translations.accessibleColumnEndHeaderContexttranslations.accessible-column-end-header-label-context :string
Provides properties to customize the accessible context for the column end header label.
See the translations attribute for usage examples.
- Since:
- 7.0.0
Names
Item Name Property translations.accessibleColumnEndHeaderLabelContexttranslations.accessible-column-header-context :string
Provides properties to customize the accessible context for the column header index.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleColumnHeaderContexttranslations.accessible-column-header-label-context :string
Provides properties to customize the accessible context for the column header label.
See the translations attribute for usage examples.
- Since:
- 7.0.0
Names
Item Name Property translations.accessibleColumnHeaderLabelContexttranslations.accessible-column-selected :string
Provides properties to customize the accessible context when a column is selected.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleColumnSelectedtranslations.accessible-column-span-context :string
Provides properties to customize the accessible context for the cell column extent/span.
See the translations option for usage examples.
- Since:
- 4.0.0
Names
Item Name Property translations.accessibleColumnSpanContexttranslations.accessible-first-column :string
Provides properties to customize the accessible context when the first column is reached.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleFirstColumntranslations.accessible-first-row :string
Provides properties to customize the accessible context when the first row is reached.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleFirstRowtranslations.accessible-last-column :string
Provides properties to customize the accessible context when the last column is reached.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleLastColumntranslations.accessible-last-row :string
Provides properties to customize the accessible context when the last row is reached.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleLastRowtranslations.accessible-level-context :string
Provides properties to customize the accessible context for the header level.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleLevelContexttranslations.accessible-multi-cell-selected :string
Provides properties to customize the accessible context when multiple cells are selected.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleMultiCellSelectedtranslations.accessible-navigation-mode :string
Provides properties to customize the accessible context to enter navigation mode.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleNavigationModetranslations.accessible-range-select-mode-off :string
Provides properties to customize the accessible context for discontinuous selection off.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRangeSelectModeOfftranslations.accessible-range-select-mode-on :string
Provides properties to customize the accessible context for discontinuous selection on.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRangeSelectModeOntranslations.accessible-row-collapsed :string
Provides properties to customize the accessible context when a row is collapsed.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRowCollapsedtranslations.accessible-row-context :string
Provides properties to customize the accessible context for the row index.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRowContexttranslations.accessible-row-end-header-context :string
Provides properties to customize the accessible context for the row end header index.
See the translations attribute for usage examples.
- Since:
- 2.1.0
Names
Item Name Property translations.accessibleRowEndHeaderContexttranslations.accessible-row-end-header-label-context :string
Provides properties to customize the accessible context for the row end header label.
See the translations attribute for usage examples.
- Since:
- 7.0.0
Names
Item Name Property translations.accessibleRowEndHeaderLabelContexttranslations.accessible-row-expanded :string
Provides properties to customize the accessible context when a row is expanded.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRowExpandedtranslations.accessible-row-header-context :string
Provides properties to customize the accessible context for the row header index.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRowHeaderContexttranslations.accessible-row-header-label-context :string
Provides properties to customize the accessible context for the row header label.
See the translations attribute for usage examples.
- Since:
- 7.0.0
Names
Item Name Property translations.accessibleRowHeaderLabelContexttranslations.accessible-row-selected :string
Provides properties to customize the accessible context when a row is selected.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleRowSelectedtranslations.accessible-row-span-context :string
Provides properties to customize the accessible context for the cell extent/span.
See the translations option for usage examples.
- Since:
- 4.0.0
Names
Item Name Property translations.accessibleRowSpanContexttranslations.accessible-selection-affordance-bottom :string
Provides properties to customize the accessible context for the bottom selection affordance on touch device.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSelectionAffordanceBottomtranslations.accessible-selection-affordance-top :string
Provides properties to customize the accessible context for the top selection affordance on touch devices.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSelectionAffordanceToptranslations.accessible-sort-ascending :string
Provides properties to customize the accessible text when a header is sorted ascending.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSortAscendingtranslations.accessible-sort-descending :string
Provides properties to customize the accessible text when a header is sorted descending.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSortDescendingtranslations.accessible-state-selected :string
Provides properties to customize the accessible context when an item has been selected.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleStateSelectedtranslations.accessible-summary-estimate :string
Provides properties to customize the accessible context read when the exact row and column count are unknown.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSummaryEstimatetranslations.accessible-summary-exact :string
Provides properties to customize the accessible context read when the exact row and column count are known.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSummaryExacttranslations.accessible-summary-expanded :string
Provides properties to customize the accessible context reading out the total number of rows expanded inside the data grid.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.accessibleSummaryExpandedtranslations.label-cut :string
Provides properties to customize the context menu cut label for row reordering.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelCuttranslations.label-disable-non-contiguous :string
Provides properties to customize the context menu label for exiting non-contiguous selection.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelDisableNonContiguoustranslations.label-enable-non-contiguous :string
Provides properties to customize the context menu label for entering non-contiguous selection.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelEnableNonContiguoustranslations.label-paste :string
Provides properties to customize the context menu paste label for row reordering.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelPastetranslations.label-resize :string
Provides properties to customize the context menu resize label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelResizetranslations.label-resize-dialog-cancel :string
Provides properties to customize the resize dialog cancel button.
See the translations attribute for usage examples.
- Since:
- 8.0.0
Names
Item Name Property translations.labelResizeDialogCanceltranslations.label-resize-dialog-submit :string
Provides properties to customize the resize dialog submit button.
See the translations attribute for usage examples.
- Since:
- 1.2.0
Names
Item Name Property translations.labelResizeDialogSubmittranslations.label-resize-height :string
Provides properties to customize the context menu resize height label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelResizeHeighttranslations.label-resize-width :string
Provides properties to customize the context menu resize width label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelResizeWidthtranslations.label-sort-col :string
Provides properties to customize the context menu sort column label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortColtranslations.label-sort-col-asc :string
Provides properties to customize the context menu sort column ascending label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortColAsctranslations.label-sort-col-dsc :string
Provides properties to customize the context menu sort column descending label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortColDsctranslations.label-sort-row :string
Provides properties to customize the context menu sort row label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortRowtranslations.label-sort-row-asc :string
Provides properties to customize the context menu sort row ascending label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortRowAsctranslations.label-sort-row-dsc :string
Provides properties to customize the context menu sort row descending label.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.labelSortRowDsctranslations.msg-fetching-data :string
Provides properties to customize the text when fetching data.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.msgFetchingDatatranslations.msg-no-data :string
Provides properties to customize the empty data grid text.
See the translations attribute for usage examples.
- Since:
- 1.1.0
Names
Item Name Property translations.msgNoDataContext Objects
Each context object contains, at minimum, a
subIdproperty, whose value is a string that identifies a particular DOM node in this element. It can have additional properties to further specify the desired node. See getContextByNode for more details.Properties:
Name Type Description subIdstring Sub-id string to identify a particular dom node. Following are the valid subIds:
-
oj-datagrid-cell
-
Context for the ojDataGrid element's cells.
Properties:
Name Type Description componentfunction a reference to the DataGrid widgetConstructor cellObject the container data object for the header dataObject the data object for the header datasourceObject a reference to the data source object indexesObject the object that contains both the zero based row index and column index in which the cell is bound to Properties
Name Type Description rownumber the zero based absolute row index columnnumber the zero based absolute column index keysObject the object that contains both the row key and column key which identifies the cell Properties
Name Type Description rownumber | string the row key columnnumber | string the column key extentsObject the object that contains both the row extent and column extent of the cell Properties
Name Type Description rownumber the row extent columnnumber the column extent modestring the mode the cell is rendered in subIdstring the subId of the cell -
oj-datagrid-header
-
Context for the ojDataGrid element's headers.
Properties:
Name Type Description axisnumber the axis of the header, possible values are 'row'/'column'/'columnEnd'/'rowEnd' componentfunction a reference to the DataGrid widgetConstructor dataObject the data object for the header datasourceObject a reference to the data source object depthnumber the the number of levels the header spans extentnumber the number of indexes the header spans indexnumber the index of the header, where 0 is the index of the first header keynumber | string the key of the header levelnumber the level of the header. The outermost header is level zero subIdstring the subId of the header -
oj-datagrid-header-label
-
Context for the ojDataGrid element's header labels.
Properties:
Name Type Description axisnumber the axis of the header label, possible values are 'row'/'column'/'columnEnd'/'rowEnd' componentfunction a reference to the DataGrid widgetConstructor dataObject the data object for the header label datasourceObject a reference to the data source object levelnumber the level of the header label. The outermost header label is level zero subIdstring the subId of the header label
Events
-
ojBeforeCurrentCell
-
Triggered before the current cell is changed via the
currentCellattribute or via the UI.Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description currentCelloj.ojDataGrid.CurrentCell.<K> the new current cell, see currentCellfor the object informationpreviousCurrentCelloj.ojDataGrid.CurrentCell.<K> the previous current cell, see currentCellfor the object information -
ojBeforeEdit
-
Triggered before the DataGrid is going to enter edit mode. To prevent editing the cell prevent default on the event.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description cellContextoj.ojDataGrid.CellContext.<K, D> the cellContext of the cell that editing is going to be performed on -
ojBeforeEditEnd
-
Triggered before the DataGrid is going to exit edit mode. To prevent exit editing the prevent default on the event. There is a provided beforeEditEnd function, oj.DataCollectionEditUtils.basicHandleEditEnd, which can be specified. This function will handle canceling edits as well as invoking validation on input elements.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description cellContextoj.ojDataGrid.CellContext.<K, D> the cellContext of the cell that editing is going to be performed on cancelEditboolean true if the edit should be negated based on actions (i.e. escape key) -
ojResize
-
Triggered when a portion of the DataGrid is resized.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description headerstring | number the key of the header which was resized oldDimensionsObject the oldDimensions Properties
Name Type Description widthnumber the old pixel size (ex: '75px' would be 75) heightnumber the old pixel size (ex: '75px' would be 75) newDimensionsObject the newDimensions Properties
Name Type Description widthnumber the new pixel size (ex: '75px' would be 75) heightnumber the new pixel size (ex: '75px' would be 75) -
ojScroll
-
Triggered after the DataGrid has been scrolled via the UI or the scrollTo method.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description scrollXnumber the x position in pixels of the scrollable region calculated from the origin of the DataGrid. In RTL this would be the right of the grid. scrollYnumber the y position in pixels of the scrollable region -
ojSort
-
Triggered when a sort is performed on the DataGrid.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description headerany the key of the header which was sorted on direction'ascending' | 'descending' the direction of the sort ascending/descending
Methods
-
getContextByNode(node) : {ojDataGrid.CellContext<K,D> & {subId: 'oj-datagrid-cell'} | ojDataGrid.HeaderContext<K,D> & {subId: 'oj-datagrid-header'} | ojDataGrid.LabelContext<K,D> & {subId: 'oj-datagrid-header-label'}}
-
Returns an object with context for the given child DOM node.
This will always contain the subid for the node, defined as the 'subId' property on the context object. Additional element specific information may also be included.
For more details on returned objects, see context objects.
Parameters:
Name Type Argument Description nodeElement <not nullable>
the child DOM node Returns:
the context for the DOM node, or null when none is found.- Type
- ojDataGrid.CellContext<K,D> & {subId: 'oj-datagrid-cell'} | ojDataGrid.HeaderContext<K,D> & {subId: 'oj-datagrid-header'} | ojDataGrid.LabelContext<K,D> & {subId: 'oj-datagrid-header-label'}
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty. The return type will be the same as the type of the property as specified in this API document. If the method is invoked with an incorrect property/subproperty name, it returns undefined.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh() : {void}
-
Redraw the entire data grid after having made some external modifications.
Returns:
- Type
- void
-
setProperties(properties) : {void}
-
Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value) : {void}
-
Sets a property or a subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.
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. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");
Type Definitions
-
CellContext<K,D>
-
context object used by cell callbacks.
Properties:
Name Type Argument Description componentElementElement a reference to the DataGrid root Element parentElementElement empty rendered cell element cellD the container data object for the header dataD the data object for the header datasourceoj.DataProvider.<K, D> | null a reference to the data source object indexesObject the object that contains both the zero based row index and column index in which the cell is bound to Properties
Name Type Description rownumber the zero based absolute row index columnnumber the zero based absolute column index keysObject the object that contains both the row key and column key which identifies the cell Properties
Name Type Description rowK the row key columnK the column key extentsObject the object that contains both the row extent and column extent of the cell Properties
Name Type Description rownumber the row extent columnnumber the column extent indexFromParentnumber <nullable>
if flattened tree data provider, the offset from the parent key parentKeyK <nullable>
if flattened tree data provider, the parent row key treeDepthnumber <nullable>
if flattened tree data provider, the depth of the node isLeafboolean <nullable>
if flattened tree data provider, true if it is a leaf node mode"edit" | "navigation" the mode the cell is rendered in -
CurrentCell<K>
-
current cell description.
Properties:
Name Type Argument Description type"cell" | "header" | "label" designates whether a header or databody cell is the current cell axis"column" | "columnEnd" | "row" | "rowEnd" <optional>
header axis, available if type is header or label indexnumber <optional>
header index, available if type is header levelnumber <optional>
header level, available if type is header or label keyany <optional>
header key, available if type is header indexesObject <optional>
cell indexes, available if type is cell Properties
Name Type Description rownumber cell row index columnnumber cell column index keysObject <optional>
cell keys, available if type is cell Properties
Name Type Description rowK cell row key columnK cell column key -
HeaderContext<K,D>
-
context object used by header callbacks.
Properties:
Name Type Argument Description componentElementElement a reference to the DataGrid root Element parentElementElement empty rendered header element dataD the data object for the header datasourceoj.DataProvider.<K, D> | null a reference to the data source object axis"column" | "columnEnd" | "row" | "rowEnd" the axis of the header indexnumber the index of the header, where 0 is the index of the first header keyK the key of the header levelnumber the level of the header. The outermost header is level zero extentnumber the number of indexes the header spans depthnumber the number of levels the header spans indexFromParentnumber <nullable>
if flattened tree data provider and row axis, the offset from the parent key parentKeyK <nullable>
if flattened tree data provider and row axis, the parent row key treeDepthnumber <nullable>
if flattened tree data provider and row axis, the depth of the node isLeafboolean <nullable>
if flattened tree data provider and row axis, true if it is a leaf node -
LabelContext<K,D>
-
context object used by header label callbacks.
Properties:
Name Type Description componentElementElement a reference to the DataGrid root Element parentElementElement empty rendered label element datasourceoj.DataProvider.<K, D> | null a reference to the data source object axis"column" | "columnEnd" | "row" | "rowEnd" the axis of the label keyK the key of the label levelnumber the level of the label -
Selection<K>
-
start of one row selection, can be on index or key or both.
Signature:
{startIndex?: {row: number, column?: number}, startKey?:{row: K, column?: K}, endIndex?: {row: number, column?: number}, endKey?:{row: K, column?: K}}