BC-14: feat: table rows clickable.

This commit is contained in:
elforjani3
2021-09-07 00:17:32 +02:00
parent 39ba31a842
commit b3439a2bc1
24 changed files with 153 additions and 4 deletions

View File

@@ -86,6 +86,10 @@ function InvoicesDataTable({
openDialog('invoice-pdf-preview', { invoiceId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('invoice-detail-drawer', { invoiceId: cell.row.original.id });
};
// Handles fetch data once the table state change.
const handleDataTableFetchData = useCallback(
({ pageSize, pageIndex, sortBy }) => {
@@ -124,6 +128,7 @@ function InvoicesDataTable({
TableLoadingRenderer={TableSkeletonRows}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
ContextMenu={ActionsMenu}
onCellClick={handleCellClick}
payload={{
onDelete: handleDeleteInvoice,
onDeliver: handleDeliverInvoice,