mdtTable
The base HTML tag for the component.
<mdt-table
[table-card="{object}"]
[selectable-rows="{boolean}"]
[virtual-repeat="{boolean}"]
[alternate-headers="{String}"]
[delete-row-callback="{function(rows)}"]
[selected-row-callback="{function(rows)}"]
[animate-sort-icon="{boolean}"]
[ripple-effect="{boolean}"]
[paginated-rows="{boolean}"]
[mdt-row="{object}"]
[mdt-row-paginator="{function(page, pageSize, options)}"]
[mdt-row-paginator-error-message="{string}"]
[mdt-row-paginator-no-results-message="{string}"]
[mdt-trigger-request="{function(loadPageCallback)}"]
[mdt-translations="{object}"]
[mdt-loading-indicator="{boolean}"]>
</mdt-table>
| Param | Type | Details |
|---|---|---|
| tableCard (optional) | object | when set table will be embedded within a card, with data manipulation tools available at the top and bottom. Properties:
|
| selectableRows (optional) | boolean | when set each row will have a checkbox |
| virtualRepeat (optional) | boolean | when set, virtual scrolling will be applied to the table. You must set a fixed
height to the |
| alternateHeaders (optional) | String | some table cards may require headers with actions instead of titles. Two possible approaches to this are to display persistent actions, or a contextual header that activates when items are selected Assignable values are:
|
| deleteRowCallback (optional) | function(rows | callback function when deleting rows.
At default an array of the deleted row's data will be passed as the argument.
When |
| selectedRowCallback (optional) | function(rows | callback function when selecting rows.
At default an array of the selected row's data will be passed as the argument.
When |
| animateSortIcon (optional) | boolean | sort icon will be animated on change |
| rippleEffect (optional) | boolean | ripple effect will be applied on the columns when clicked (not implemented yet) |
| paginatedRows (optional) | boolean | if set then basic pagination will applied to the bottom of the table. |
| mdtRow (optional) | object | passing rows data through this attribute will initialize the table with data. Additional
benefit instead of using Properties:
|
| mdtRowPaginator (optional) | function(page, pageSize, options | providing the data for the table by a function. Should set a
function which returns a promise when it's called. When the function is called, these parameters will be
passed: Currently these are available from options:
|
| mdtRowPaginatorErrorMessage (optional) | string | overrides default error message when promise gets rejected by the paginator function. |
| mdtRowPaginatorNoResultsMessage (optional) | string | overrides default 'no results' message. |
| mdtTriggerRequest (optional) | function(loadPageCallback | provide a callback function for manually triggering an ajax request. Can be useful when you want to populate the results in the table manually. (e.g.: having a search field in your page which then can trigger a new request in the table to show the results based on that filter. |
| mdtTranslations (optional) | object | accepts various key-value pairs for custom translations. |
| mdtLoadingIndicator (optional) | boolean | if set then loading indicator can be customised |
mdt-row attribute:When column names are: Product name, Creator, Last Update
The passed data row's structure: id, item_name, update_date, created_by
Then the following setup will parse the data to the right columns:
<mdt-table
mdt-row="{
'data': controller.data,
'table-row-id-key': 'id',
'column-keys': ['item_name', 'update_date', 'created_by']
}">
<mdt-header-row>
<mdt-column>Product name</mdt-column>
<mdt-column>Creator</mdt-column>
<mdt-column>Last Update</mdt-column>
</mdt-header-row>
</mdt-table>