Controls
Last updated
Last updated
object-table
controls
allow the user to interact with the table and its data. They include a search box and pagination controls. They will display at the bottom of an object-table
by default, but can also be hidden or positioned at the top and/or bottom.
Parameter | Description | Example |
---|---|---|
| Positions table controls at the top of the table |
|
| Positions table controls at top AND bottom of the table |
|
| Positions controls at the bottom of the table |
|
| No controls |
|
controls
positioned at the top
The top
position is useful if the height of the table will be changing drastically due to large amounts of non-deterministic content. Placing the controls at the top prevents the buttons from constantly moving up and down when pages are changed.
controls
positioned at both
(top and bottom)controls
positioned at the bottom
controls
positioned at none
(no controls)Tip: It is advised to set a larger limit, for visibility, when controls are hidden.
When controls are set to none
and the number of entries exceeds the object-table
limit
, a "Show more" button will appear.
When an object-table
has sticky headers and/or footers along with mode="paginate"
, the controls will also be present in the corresponding sticky header or footer.
Action buttons appear in the controls. The purpose of these buttons are to provide table actions that should in most cases, apply to the table itself.
Since space inside table controls are limited, the buttons employ a best fit algorithm to expand or collapse based on the available space in the render area.
Action buttons follow the same syntax as button-group
.
Exposing data
Since action buttons will mostly be used by engineers to apply batch operations to the data, a few variables are exposed to the on-press
function:
parameter | description | example |
---|---|---|
$filteredData | All table data, this also contains all the hidden column data |
|
filteredDisplayData | Exactly the same as |
|
controls | The state of the table based on the current controls |
|
Split buttons
In cases where the engineer wants to force the first button to be visible but collapse the rest mode="split"
can be used on the button-group.
Scrollable table
When a scrollable table is used instead of a paginated table, the action buttons are still present even without the rest of the controls: