阳刚的板凳 · PHP 文件上传 | 菜鸟教程· 1 年前 · |
玉树临风的黄瓜 · date_histogram 日期显示不全 ...· 1 年前 · |
慷慨大方的吐司 · react中的ReactQuill ...· 1 年前 · |
selectionMode
for rows is enabled, selects the row as well.
If multiple selection is enabled the selection handles will appear. Tapping a different row will deselect the previous selection.
Press & Hold
Display context menu
Column Header
Focus on the header. If
selectionMode
for columns is enabled, selects the column as well.
Press & Hold
Display context menu
The first Tab into the Table moves focus to the first column header. The second Tab moves focus to the next focusable element outside of the Table.
editMode
is rowEdit, please see the section 'Cell in EditableRow'.
Shift+Tab
The first Shift+Tab into the Table moves focus to the first column header. The second Shift+Tab moves focus to the previous focusable element outside of the Table.
editMode
is rowEdit, please see the section 'Cell in EditableRow'.
DownArrow
Move focus to the next row.
Shift+DownArrow
Select and move focus to the next row.
Shift+F10
Display context menu.
Ctrl+DownArrow
Move focus to the column footer.
UpArrow
Move focus to the previous row. If at the first row then move to the column header.
Shift+UpArrow
Select and move focus to the previous row.
Ctrl+UpArrow
Move focus to the column header.
LeftArrow
Move accessibility focus to the cell to the left (only applies when using a screen reader).
RightArrow
Move accessibility focus to the cell to the right (only applies when using a screen reader).
Move focus to first row.
Move focus to last row.
Space
Select row.
Enter
If the table
editMode
is rowEdit then make the current row editable.
editMode
is none then toggle the current row to actionable mode if there exists a tabbable element in the row. Once toggled to actionable mode, focus will be moved to be first tabbable element in the row.
Toggle the current row to actionable mode if there exists a tabbable element in the row. Once toggled to actionable mode, focus will be moved to be first tabbable element in the row.
Cell in Editable Row
Move focus to next editable cell or focusable element in the row.
Developers should always either specify the
aria-label
attribute or use other alternatives for the table element to conform to accessibility guidelines.
Nesting collection components such as ListView, Table, TreeView, and Table inside of Table is not supported.
To facilitate drag and drop including row reordering using only keyboard, application must ensure that either to expose the functionality using context menu, and/or allow users to perform the functionality with the appropriate keystroke. You can find examples of how this can be done in the cookbook demos.
Hiding Column headers is not supported by table to avoid accessibility issues.
Using colors, including background and text colors, is not accessible if it is the only way information is conveyed. Low vision users may not be able to see the different colors, and in high contrast mode the colors are removed. The Redwood approved way to show status is to use badge.
Performance
As a rule of thumb, it's recommended that applications limit the amount of data displayed in a Table. Displaying a large
number of items in a Table makes it hard for users to find what they are looking for, and affects the rendering performance
as well. If displaying a large number of items is necessary, consider using a search control with the Table. This will allow
the user to filter data and display only the rows desired. Also consider setting
scrollPolicy
to 'loadMoreOnScroll' to enable high-water mark scrolling to reduce the number of items to display initially.
The Table allows developers to specify arbitrary content inside its cells. In order to minimize any negative effect on performance, you should avoid putting a large number of heavy-weight components inside a cell because as you add more complexity to the structure, the effect will be multiplied because there can be many items in the Table.
label-hint/label-edge
are expected as attributes when
oj-input-text
is used for accessibility purpose in
oj-form-layout
.
Since
oj-table
itself handles accessibility for cell content, user does not need to add attributes
label-hint/label-edge
when
oj-input-text
is used.
But for read-only texts, it is a best practice to avoid using
oj-input-text
, prefer
oj-bind-text
or plain html instead.
The Table's
layout
attribute can have a significant effect on rendering performance. When set to
contents
(the default value), the Table's initial column widths are determined by the size of its rendered
contents. Although this ensures column widths are appropriately sized in most cases, this convenience can lead to long initial render times
depending on the number of rows and columns. When set to
fixed
, the Table's column widths are determined
using the specified
columns[].weight
values. This is much more performant when rendering large numbers of
columns and rows in the Table.
Sizing Behavior
By default, the Table does not support being rendered within flex layouts that specify a flex-basis value that is dependent on content sizes.
To ensure that the Table renders correctly, applications should specify a real flex-basis value on any flex layouts containing a Table. If that
is not possible, applications may choose to use the
oj-table-stretch
style class on the Table. This should
enable the Table to render correctly within any flex layout, but requires that the Table's outer size is set to a non-auto value in the
non-flex direction. For example, for a horizontal flex layout, the application must specify a height on the Table (400px, 50vh, etc.). For a
vertical flex-layout, the application must specify a width on the Table (400px, 100%, etc.). A max-height or max-width is not sufficient.
Applications can customize animations triggered by actions in Table by overriding action specific style classes on the animated item. To disable animations for all tables, the CSS variable values can be modified to specify empty effects. See the documentation of AnimationUtils class for details.
The following are actions in which applications can use to customize animation effects. Action Description
Depending on the Theme, the Table may have a solid default background color. If a different background color is desired, it can be changed by adding a background color class on the Table. See table background color demo for examples.
Custom Data AttributesTable supports the following custom data attributes. Description Example data-oj-as Provides an alias for a specific template instance and has the same subproperties as the $current variable.
<oj-table id="table">
<template slot="cellTemplate" data-oj-as="cell">
</template>
</oj-table>
data-oj-clickthrough
Specify on any element inside a cell where you want to control whether the Table should perform actions triggered by a click event originating from the element or one of its descendants.
For example, if you specify this attribute with a value of "disabled" on a button inside a cell, then the Table will not select or set the corresponding row as current when a user clicks on the button.
<oj-table id="table">
<template slot="cellTemplate">
<oj-button data-oj-clickthrough="disabled"></oj-button
</template>
</oj-table>
//To typecheck the element APIs, import as below.
import { TableElement } from "ojs/ojtable";
//For the transpiled javascript to load the element's module, import as below
import "ojs/ojtable";
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.
Used to style a table cell so that it has no padding.<oj-table id="tableId" class='oj-table-data-cell-no-padding'>
</oj-table>
Used to style a table cell so that it has default padding.
<oj-table id="tableId" class='oj-table-data-cell-padding'>
</oj-table>
Used to explicitly hide the vertical scrollbar when the table body is scrollable.
<oj-table id="tableId" class='oj-table-hide-vertical-scrollbar'>
</oj-table>
Used to notify the Table that it should stretch its inner contents to fill all available horizontal and vertical space.
This requires that the Table's outer dimensions are controlled externally, either by its containing layout or by height and width
values being set on it.
<oj-table id="tableId" class='oj-table-stretch'>
</oj-table>
Named slot used to render add new row at the top of the table. The slot content must be a <template> element. The content of the template should not include the <td> element, only what's inside it.
Named slot used to render add new row at the top of the table. The slot content must be a <template> element. The content of the template can include the <tr> element or the child of the <tr> element.
If using an addRowTemplate to configure the display of rows, the Table will handle any change in column reordering due to a dnd operation internally. Any application logic behind addRowTemplate definitions should not dynamically respond to 'columns' change notifications pushed due to dnd reorder operations. Once an application or an external source updates the Table's 'columns' attribute though, the Table will no longer honor any previous user-performed dnd reorder operations, and any relevant changes in logic needed for the addRowTemplate definitions must be handled by the application.
When providing inline template content that includes table-specific markup such as <tr> or <td> elements, applications are responsible for ensuring that the content provided is valid HTML. For example, providing an <oj-bind-if> element as the child of a <tr> is not valid HTML, and will not function as intended. To enable this type of dynamic template functionality, the entire Table can be defined within an <oj-module>, or an <oj-bind-dom> element can be provided as the child of an inline template.
Named slot for the Table's bottom panel where applications can add content such as a paging control. The Table will render the content provided at the bottom of the Table element. The content specified should not include any styling that may conflict with the Table's positioning. Unsupported styling includes, but is not limited to, margins and absolute positioning.
Named slot for the Table's default cell template. The slot content must be a <template> element. The content of the template should not include the <td> element, only what's inside it.
If the value of any column's
template
,
headerTemplate
, or
footerTemplate
property conflicts with this named slot, this slot will only be used for that column.
Similarly, if a value is supplied for the deprecated
columns-default.template
attribute, that named slot will be used as the default cell template slot instead of this named slot.
When the template is executed for the cell, it will have access to the binding context containing the following properties:
The contextMenu slot is set on the
oj-menu
within 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.
Named slot for the Table's default footer template. The slot content must be a <template> element. The content of the template should not include the <td> element, only what's inside it.
If the value of any column's
template
,
headerTemplate
, or
footerTemplate
property conflicts with this named slot, this slot will only be used for that column.
Similarly, if a value is supplied for the deprecated
columns-default.footer-template
attribute, that named slot will be used as the default footer template slot instead of this named slot.
Named slot for the Table's default header template. The slot content must be a <template> element. The content of the template should not include the <td> element, only what's inside it.
If the value of any column's
template
,
headerTemplate
, or
footerTemplate
property conflicts with this named slot, this slot will only be used for that column.
Similarly, if a value is supplied for the deprecated
columns-default.header-template
attribute, that named slot will be used as the default header template slot instead of this named slot.
Named slot for the Table's default row template. The slot content must be a <template> element. The content of the template can include the <tr> element or the child of the <tr> element.
If using a rowTemplate to configure the display of rows, the Table will handle any change in column reordering due to a dnd operation internally. Any application logic behind rowTemplate definitions should not dynamically respond to 'columns' change notifications pushed due to dnd reorder operations. Once an application or an external source updates the Table's 'columns' attribute though, the Table will no longer honor any previous user-performed dnd reorder operations, and any relevant changes in logic needed for the rowTemplate definitions must be handled by the application.
When providing inline template content that includes table-specific markup such as <tr> or <td> elements, applications are responsible for ensuring that the content provided is valid HTML. For example, providing an <oj-bind-if> element as the child of a <tr> is not valid HTML, and will not function as intended. To enable this type of dynamic template functionality, the entire Table can be defined within an <oj-module>, or an <oj-bind-dom> element can be provided as the child of an inline template.
Property change listener attribute ( must be of type function, see Events and Listeners for additional information. )
on-accessibility-changed
The column ids to be used as the row headers by screen readers. This can be a string if there is only one
column id, or an array of strings if multiple column ids are desired.
This is required by screen readers. By default the first column will be taken as the row header.
See the accessibility attribute for usage examples.
Property change listener attribute ( must be of type function, see Events and Listeners for additional information. )
on-add-row-display-changed
An alias for the current context when referenced inside the cell template. This can be especially useful
if oj-bind-for-each element is used inside the cell template since it has its own scope of data access.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-as-changed
An array of column definitions.
If the application change the column definitions after the Table is loaded, it must call the
refresh()
method to update the Table display.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-columns-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-columns-default-changed
The row that currently has keyboard focus. Can be an index and/or key value.
When both are specified, the index is used as a hint.
Returns the current row or null if there is none.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-current-row-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-data-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-display-changed
Enable drag and drop functionality.
JET provides support for HTML5 Drag and Drop events. Please refer to
third party documentation
on HTML5 Drag and Drop to learn how to use it.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-dnd-changed
If this object is specified, the table will initiate drag operation when the user drags on selected rows.
See the
dnd
attribute for usage examples.
The MIME types to use for the dragged data in the dataTransfer object. This can be a string if there is only one
type, or an array of strings if multiple types are needed.
For example, if selected rows of employee data are being dragged, dataTypes could be "application/employees+json". Drop targets can examine the data types and decide
whether to accept the data. A text input may only accept "text" data type, while a chart for displaying employee data may be configured to accept the "application/employees+json" type.
For each type in the array, dataTransfer.setData will be called with the specified type and the JSON version of the selected rows data as the value. The selected rows data
is an array of objects, with each object representing one selected row in the format returned by TableDataSource.get().
This property is required unless the application calls setData itself in a dragStart callback function.
A callback function that receives the "drag" event as its argument.
function(event)
Parameters:
event
: The DOM event object
A callback function that receives the "dragend" event as its argument.
function(event)
Parameters:
event
: The DOM event object
A callback function that receives the "dragstart" event and context information as its arguments.
function(event, context)
Parameters:
event
: The DOM event object
context
:
oj.ojTable.DragRowContext
object with the following properties:
rows
: An array of objects, with each object representing the data of one selected row in the structure below:
data
The raw row data
index
The index for the row
key
The key value for the row
This function can set its own data and drag image as needed. If dataTypes is specified, event.dataTransfer is already populated with the default data when this function is invoked.
If dataTypes is not specified, this function must call event.dataTransfer.setData to set the data or else the drag operation will be cancelled. In either case, the drag image is
set to an image of the selected rows visible on the table.
An object that specifies callback functions to handle dropping columns
event
: The DOM event object
context
: Context object with the following properties:
columnIndex
: The index of the column being dropped on
See the
dnd
attribute for usage examples.
A callback function that receives the "dragenter" event and context information as its arguments.
function(event, context)
This function should call
event.preventDefault()
to indicate the dragged data can be accepted.
Calling
event.preventDefault()
is required by HTML5 Drag and Drop to indicate acceptance of data.
If dataTypes is specified, it will be matched against the drag data types to determine if the data is acceptable. If there is a match, JET will call
event.preventDefault()
to indicate that the data can be accepted.
A callback function that receives the "dragleave" event and context information as its arguments.
function(event, context)
A callback function that receives the "dragover" event and context information as its arguments.
function(event, context)
Similar to dragEnter, this function should call
event.preventDefault()
to indicate the dragged data can be accepted. If dataTypes is specified,
it will be matched against the drag data types to determine if the data is acceptable.
A required callback function that receives the "drop" event and context information as its arguments.
function(event, context)
This function should call
event.preventDefault()
to indicate the dragged data is accepted.
An object that specifies callback functions to handle dropping rows
For all callback functions, the following arguments will be passed:
event
: The DOM event object
context
: Context object with the following properties:
rowIndex
: The index of the row being dropped on
See the
dnd
attribute for usage examples.
A callback function that receives the "dragenter" event and context information as its arguments.
function(event, context)
This function should call
event.preventDefault()
to indicate the dragged data can be accepted.
Calling
event.preventDefault()
is required by HTML5 Drag and Drop to indicate acceptance of data.
If dataTypes is specified, it will be matched against the drag data types to determine if the data is acceptable. If there is a match, JET will call
event.preventDefault()
to indicate that the data can be accepted.
A callback function that receives the "dragleave" event and context information as its arguments.
function(event, context)
A callback function that receives the "dragover" event and context information as its arguments.
function(event, context)
Similar to dragEnter, this function should call
event.preventDefault()
to indicate the dragged data can be accepted. If dataTypes is specified,
it will be matched against the drag data types to determine if the data is acceptable.
A required callback function that receives the "drop" event and context information as its arguments.
function(event, context)
This function should call
event.preventDefault()
to indicate the dragged data is accepted.
If the application needs to look at the data for the row being dropped on, it can use the getDataForVisibleRow method.
Enable or disable reordering the columns within the same table using drag and drop.
Re-ordering is supported one column at a time. In addition, re-ordering will not re-order
any cells which have the colspan attribute with value > 1. Such cells will need to be re-ordered manually by listening to
the property change event on the columns property.
If using a rowTemplate, rowRenderer, or addRowTemplate to configure the display of rows, the Table will handle
any change in column reordering due to a dnd operation internally. Any application logic behind rowTemplate,
rowRenderer, or addRowTemplate definitions should not dynamically respond to 'columns' change notifications pushed
due to dnd reorder operations. Once an application or an external source updates the Table's 'columns' attribute
though, the Table will no longer honor any previous user-performed dnd reorder operations, and any relevant changes
in logic needed for the rowTemplate, rowRenderer, or addRowTemplate definitions must be handled by the application.
See the
dnd
attribute for usage examples.
Determine if the table is read-only or editable. Use 'none' if the table is strictly read-only and will be a single Tab stop on the page.
Use 'rowEdit' if you want single row at a time editability. The table will initially render with all rows in read-only mode. Pressing Enter/F2 or double click will make the current row editable and pressing Tab navigates to the next cell. Pressing ESC/F2 while in this mode will switch the table back to all rows in read-only mode and will be a single Tab stop the page.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-edit-mode-changed
The information about the row that is currently being edited. The value of this property contains:
on-edit-row-changed
Gets the key and data of the first selected row. The first selected row is defined as the first
key returned by the
selection
property. The value of this property contains:
on-first-selected-row-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-horizontal-grid-visible-changed
on-layout-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-row-changed
A function that returns whether the row can be edited.
See
Item
to see the object passed into the editable function.
If no function is specified, and edit-mode is set to "rowEdit" then all the rows will be editable.
If selection-mode.row is 'multiple' or 'single', this callback will be invoked and allows apps to control selection on individual rows.
See
Item
to see the object passed into the selectable function.
If no function is specified then all the rows will be selectable, unless selection-mode.row is not set to "none".
In addition,
row.selectable
does not impact column selection modes.
If an
AllKeySetImpl
is set on the table the table will not show those rows as selected.
However, the table will not add the non-selectable keys to AllKeySets's deletedValues set.
If selection-mode.row = 'multiple', turning selection off for a particular row will remove the oj-selector and increase the span of the td in the first column by one for that row.
A function that returns whether the row should be sticky.
See
Item
to see the object passed into the sticky function.
If no function is specified, no rows will be sticky.
A function that renders the content of the row. The function takes a context argument, provided by the Table.
If using a rowRenderer to configure the display of rows, the Table will handle any change in column reordering due to a dnd operation internally. Any application logic behind rowRenderer definitions should not dynamically respond to 'columns' change notifications pushed due to dnd reorder operations. Once an application or an external source updates the Table's 'columns' attribute though, the Table will no longer honor any previous user-performed dnd reorder operations, and any relevant changes in logic needed for the rowRenderer definitions must be handled by the application.
Property change listener attribute ( must be of type function, see Events and Listeners for additional information. )
on-row-renderer-changed
Specifies the mechanism used to scroll the data inside the table. Possible values are: "auto", "loadMoreOnScroll", and "loadAll".
When "loadMoreOnScroll" is specified, additional data are fetched when the user scrolls to the bottom of the table.
When "loadAll" is specified, table will fetch all the data when it is initially rendered.
If you are using Paging Control with the Table, please note that "loadMoreOnScroll" scroll-policy is not compatible with
Paging Control "loadMore" mode.
Determined by element. The default is to have the same behavior as "loadMoreOnScroll" except when
legacy TableDataSource is used, in which case the behavior is the same as "loadAll".
Additional data are fetched when the user scrolls to the bottom of the table. This option should be used
only when table height is specified.
on-scroll-policy-changed
scrollPolicy options.
When scrollPolicy is loadMoreOnScroll, the next block of rows is fetched
when the user scrolls to the end of the table. The fetchSize property
determines how many rows are fetched in each block.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-scroll-policy-options-changed
The number of rows to fetch in each block of rows. The specified number is passed to the underlying data provider through
the size attribute of the fetch first parameters. Note, the underlying data provider may not request that exact number from the back end.
See the scroll-policy-options attribute for usage examples.
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.
The CSS selector string to an element which Table uses to determine the scroll position as well as the maximum scroll position.
on-scroll-position-changed
Specifies the behavior when table needs to scroll to a position based on a row key. This includes the case where 1) a value of
scrollPosition attribute is specified with a key property, 2) Table scrolls to the selection anchor after a refresh has occurred.
The behavior is determined by the component. By default the behavior is the same as "capability" except
when legacy TableDataSource is used, in which case the behavior is the same as "always".
Table will only scroll to a position based on a row key if either the row has already been fetched
or if the associated DataProvider supports 'immediate' iterationSpeed for 'fetchFirst' capability.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-scroll-to-key-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-select-all-control-changed
Specifies the current selected rows and/or columns in the table.
Note that property change event for the deprecated selection property will still be fired when
selected property has changed. In addition,
AllKeySetImpl
set can be used to represent
select all state. In this case, the value for selection would have an 'inverted' property set to true,
and would contain index/key of the rows that are not selected.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-selected-changed
Specifies the current selections in the table. Can be either an index or key value.
When both are specified, the index is used as a hint.
Returns an array of range objects, or an empty array if there's no selection.
Note that this attribute has been replaced by
selected
, and it is recommended that
applications use the selected attribute going forward.
Selection range object has following subproperties:
startIndex, startKey - In case of row selection, startIndex and startKey refers to first row(which is near to table header) in range selection.
In case of column selection, startIndex and startKey refers to first column in range selection.
endIndex, endKey - In case of row selection, endIndex and endKey refers to last row(which is far from table header) in range selection.
In case of column selection, endIndex and endKey refers to last column in range selection.
startIndex, startKey, endIndex and endKey are of type object. In case of row selection, these objects will have 'row' subpropety. In case of column selection, objects will have 'column' subproperty.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-selection-changed
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-selection-mode-changed
The type of column selection behavior that is enabled on the Table. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
single
or
multiple
is specified, selection gestures will be enabled, and the Table's selection styling will be applied to all columns specified by the
selection
and
selected
attributes.
If
none
is specified, selection gestures will be disabled, and the Table's selection styling will not be applied to any columns specified by the
selection
and
selected
attributes.
Changing the value of this attribute will not affect the value of the selection or selected attributes.
See the selection-mode attribute for usage examples. By default, this element does not allow any selection. (As a note, the 'id' property of each column is required when column selection is enabled).
The type of row selection behavior that is enabled on the Table. This attribute controls the number of selections that can be made via selection gestures at any given time.
If
single
or
multiple
is specified, selection gestures will be enabled, and the Table's selection styling will be applied to all rows specified by the
selection
and
selected
attributes.
If
none
is specified, selection gestures will be disabled, and the Table's selection styling will not be applied to any rows specified by the
selection
and
selected
attributes.
Changing the value of this attribute will not affect the value of the selection or selected attributes.
See the selection-mode attribute for usage examples. By default, this element does not allow any selection.
Specifies whether selection is required on the Table. When row selection is enabled, this attribute will take effect when at least
one row is present. When
true
, the Table will ensure that at least one valid row is selected at all
times. If no rows are specified by the
selection
or
selected
attributes, the first
row in the Table will be added to the selection state during initial render. Additionally, selection gestures that would otherwise
leave the Table with no selected rows will be disabled.
When
true
, the Table will also attempt to validate all rows specified by the
selection
and
selected
attributes. If any rows specified are not immediately
available, the Table's underlying
DataProvider
will be queried. This will only occur if the
data provider supports
getCapability
, and returns a
fetchByKeys capability implementation
of
lookup
.
Any rows that fail this validation process will be removed from the
selection
and
selected
attributes. This guarantees that the Table's
firstSelectedRow
attribute is populated at all times.
Otherwise, when column selection is enabled, this attribute will take effect when at least one column is present. When
true
, the Table will ensure that at least one valid column is selected at all times. If no
columns are specified by the
selection
or
selected
attributes, the first
column in the Table will be added to the selection state during initial render. Additionally, selection gestures that would otherwise
leave the Table with no selected columns will be disabled.
See
selectionMode
for information on how to enable or disable selection on the Table.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-selection-required-changed
A collection of translated resources from the translation bundle, or
null
if 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.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-translations-changed
Provides properties to customize the accessible context read when the exact row count is unknown.
See the translations attribute for usage examples.
Provides properties to customize the accessible context read when the exact row count is known.
See the translations attribute for usage examples.
Provides properties to customize the context menu label for exiting non-contiguous selection.
See the translations attribute for usage examples.
Provides properties to customize the context menu label for entering non-contiguous selection.
See the translations attribute for usage examples.
Warning message summary that maxCount has been reached for scrollPolicy=loadMoreOnScroll.
See the
translations
attribute for usage examples.
Property change listener attribute (
must be of type function, see
Events and Listeners
for additional information.
)
on-vertical-grid-visible-changed
Each context object contains, at minimum, a
subId
property,
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.
event.preventDefault
.
If the event listener calls
event.preventDefault
to cancel the default animation, it must call the
event.detail.endCallback
function when it finishes its own animation handling.
Row animations will only be triggered for rows in the current viewport and an event will be triggered for each cell in the animated row.
This method can be called with an application-created Promise to cancel this event asynchronously.
The Promise should be resolved or rejected to accept or cancel the event, respectively.
This method can be called with an application-created Promise to cancel this event asynchronously.
The Promise should be resolved or rejected to accept or cancel the event, respectively.
Triggered before the table is going to exit edit mode. To prevent exit editing, call
event.preventDefault()
in the listener.
There is a provided beforeRowEditEnd function, oj.DataCollectionEditUtils.basicHandleRowEditEnd, which can be specified.
This function will handle canceling edits as well as invoking validation on input elements.
This method can be called with an application-created Promise to cancel this event asynchronously.
The Promise should be resolved or rejected to accept or cancel the event, respectively.
This method can be called with an application-created Promise to resolve with updated row item object. This method can be called in synchronous or asynchronous editing.
In case of asynchronous editing this method should be involked before resolving accept promise.
This is an optional method to prevent table from calling fetch on the dataprovider and also useful when application know about the no data change for the row.
Note: If called more than once, only the most recent Promise provided will be honored.
Triggered when user performs an action gesture on a row while Table is in navigation mode. The action gestures include:
a compound object which has the structure below. If the row has not been rendered, returns null.
data The raw row data index The index for the row key The key value for the row 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. 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. 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. A function that renders the content of the footer cell. The function takes a context argument, provided by the Table. If no renderer is specified, the Table will treat the footer data as a string.
The function should return one of the following:
When the template is executed for each footer, it will have access to the binding context containing the following properties:
The function should return one of the following:
When the template is executed for each header, it will have access to the binding context containing the following properties:
The maximum width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
The minimum width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
The string keyword
'auto'
indicates that the minimum width will be determined by the theme and the
layout
attribute.
The function should return one of the following:
When the template is executed for the cell, it will have access to the binding context containing the following properties:
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 the Table's
layout
attribute is set to
contents
.
The width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
A function that renders the content of the footer cell. The function takes a context argument, provided by the Table. If no renderer is specified, the Table will treat the footer data as a string.The function should return one of the following:
When the template is executed for each footer, it will have access to the binding context containing the following properties:
The function should return one of the following:
When the template is executed for each header, it will have access to the binding context containing the following properties:
The maximum width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
The minimum width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
The string keyword
'auto'
indicates that the default minimum width will be determined by the theme and the
layout
attribute.
The function should return one of the following:
When the template is executed for the cell, it will have access to the binding context containing the following properties:
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 the Table's
layout
attribute is set to
contents
.
The width style string of the column. This value is used during initial render, and does not affect the ability to resize the column.
This style is applicable when
layout='fixed'
and
layout='contents'
.
User can pass any size unit as part of string value(20rem, 30%, 10px, etc.). If units are not included or number value is aasigned then pixels will be used as the size unit.
An array of objects, with each object representing the data of one selected row in the structure below.阳刚的板凳 · PHP 文件上传 | 菜鸟教程 1 年前 |