Our DataGrid is based on MUI's DataGrid, and you can find the documentation here: https://mui.com/x/react-data-grid/
We've added some custom props :
- to the DataGrid component
- in the slot toolbar of the DataGrid component to mimic Virtual Table toolbar
Custom DataGrid props
Name | Type | Required | Default | Description |
---|
rowContextMenu | object | No | | Configuration object to enable and customize a context menu shown when right-clicking a row. |
Name | Type | Required | Default | Description |
---|
canOpen | function | No | | Callback that determines whether the context menu should open. Receives the selected rows as an argument and should return true to allow the menu or false to prevent it. |
actions | array | Yes | | Array of action definitions to be displayed in the context menu. |
Name | Type | Required | Default | Description |
---|
key | string | Yes | | Unique identifier for the action. |
label | string | Yes | | Text label displayed for the action. |
disabled | boolean | function | No | false | Disables the action if true. If a function is provided, it will be called with the selected rows and should return a boolean. |
onClick | function | Yes | | Callback triggered when the action is clicked. Receives the selected rows as an argument. |
Name | Type | Required | Default | Description |
---|
customButtons | array | No | | Display custom buttons to the left of the right-side button area. |
deleteAction | object | No | | Enables deletion and displays the delete button after the custom buttons. |
bulkEditAction | object | No | | Enables bulk editing and displays save and cancel buttons after the custom buttons. |
Name | Type | Required | Default | Description |
---|
key | string | number | Yes | | Unique identifier for the button, also used to generate the data-id attribute. |
type | 'text' | 'icon' | No | 'text' | Defines whether the button displays text or an icon. |
- text | string | Yes | | The button label, used when type is set to 'text' . |
- icon | component | Yes | | The icon component to display when type is set to 'icon '. |
color | ButtonProps['color'] | No | 'primary' | Sets the button color, based on MUI's color palette. |
disabled | boolean | No | false | If true, the button is disabled. |
onClick | function | Yes | | Callback triggered on button click. Receives selected row IDs and selected row data as arguments. |
deleteAction
Name | Type | Required | Default | Description |
---|
disabled | boolean | No | false | If true, the button is disabled. |
onDelete | function | Yes | | Callback triggered on button click. Receives selected row IDs and returns a boolean indicating success, used to automatically unselect the rows if success. |
bulkEditAction
Name | Type | Required | Default | Description |
---|
disabled | boolean | No | false | If true, the button is disabled. |
onBulkEditSave | function | Yes | | Callback triggered on button click. Receives selected row IDs and new rows and returns a boolean indicating success, used to automatically unselect the rows if success or cancel modification if not. |