Skip to main content

Documentation

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

NameTypeRequiredDefaultDescription
rowContextMenuobjectNoConfiguration object to enable and customize a context menu shown when right-clicking a row.

rowContextMenu

NameTypeRequiredDefaultDescription
canOpenfunctionNoCallback 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.
actionsarrayYesArray of action definitions to be displayed in the context menu.
rowContextMenu.actions
NameTypeRequiredDefaultDescription
keystringYesUnique identifier for the action.
labelstringYesText label displayed for the action.
disabledboolean | functionNofalseDisables the action if true. If a function is provided, it will be called with the selected rows and should return a boolean.
onClickfunctionYesCallback triggered when the action is clicked. Receives the selected rows as an argument.

Custom SlotProps.toolbar props

NameTypeRequiredDefaultDescription
customButtonsarrayNoDisplay custom buttons to the left of the right-side button area.
deleteActionobjectNoEnables deletion and displays the delete button after the custom buttons.
bulkEditActionobjectNoEnables bulk editing and displays save and cancel buttons after the custom buttons.

customButtons

NameTypeRequiredDefaultDescription
keystring | numberYesUnique 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.
- textstringYesThe button label, used when type is set to 'text'.
- iconcomponentYesThe icon component to display when type is set to 'icon'.
colorButtonProps['color']No'primary'Sets the button color, based on MUI's color palette.
disabledbooleanNofalseIf true, the button is disabled.
onClickfunctionYesCallback triggered on button click. Receives selected row IDs and selected row data as arguments.

deleteAction

NameTypeRequiredDefaultDescription
disabledbooleanNofalseIf true, the button is disabled.
onDeletefunctionYesCallback triggered on button click. Receives selected row IDs and returns a boolean indicating success, used to automatically unselect the rows if success.

bulkEditAction

NameTypeRequiredDefaultDescription
disabledbooleanNofalseIf true, the button is disabled.
onBulkEditSavefunctionYesCallback 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.