Minimal usage
data
data is an array of object. A column for each keys of each object will be automatically displayed.
Advanced usage
columns
columns forces the columns you want and format their rows content. It’s an array of objects with following attributes:
keyis the name of the object key in your data. This example should displys three columns “label”, “value” and “anotherValue” but with this configuration will display only the two first columns.labelis the text displayed in column header. It can be as string or a localized string. This example wil show two columns with translated name:descriptiondisplays a tooltip with a (i) button next to the column name.typechange the value type. Default is string but you can force a type to get a specific display. Type can take a value from:- string
- number
- boolean
- date
- tags
formatcan format a number or a date value with a custom format. Value can be:- Options of Intl.DateTimeFormat
- Options of Intl.NumberFormat
sortableset if the column can be sorted. Default is true. If false, the column header cannot be clicked.
loading
loading display a placeholder while loading data from an automation. Update the value while sending the data:
pagination
pagination set the pagination which can be managed on client side with the current data list or on server side by exchanging events. It’s an object with the following options:
eventis the event send when clicking a button in the pagination component. It takespageattribute in payload.payloadis a custom payload which will be merged with thepagevalue when sending theevent.pageis the current displayed page.itemCountis the total of items. It’s mandatory to display the correct number of pages.pageSizeis the number of items per page. Default is 10.
event.
displayPerPage
displayPerPage display the “items per page” selector. Value can be true or an array of number you want to propose to your user. Default is [10, 20, 50, 100].
onSort
onSort is an event name fired when clicking a sortable column header. It can be a string or an object with event and payload.
bulkActions
WhenbulkActions is set, rows can be selected and a menu with actions set in this attribute will be displayed. Value is an array of object containing:
onSelectis an event name or on object witheventandpayload.labelis the label displayed. Value is a string or a localized string
onBulkChange
onBulkChange is an event name or on object with event and payload fired each
time the bulk selection changes. USefull if you want to change something in your interface when a selection exists.The event payload contains
selectedRowKeys and selectedRows. First one is an array of selected row keys, the other is an array of selected items data.
resetSelectionOn
resetSelectionOn is an event which will reset the bulk selection when fired. Usefull after an action in bulk actions menu is clicked.