mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
BC-14: feat: table rows clickable.
This commit is contained in:
@@ -107,6 +107,11 @@ function ItemsDataTable({
|
||||
return <ItemsEmptyStatus />;
|
||||
}
|
||||
|
||||
// Handle cell click.
|
||||
const handleCellClick = (cell, event) => {
|
||||
openDrawer('item-detail-drawer', { itemId: cell.row.original.id });
|
||||
};
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
columns={columns}
|
||||
@@ -131,6 +136,7 @@ function ItemsDataTable({
|
||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||
ContextMenu={ItemsActionMenuList}
|
||||
onFetchData={handleFetchData}
|
||||
onCellClick={handleCellClick}
|
||||
payload={{
|
||||
onDeleteItem: handleDeleteItem,
|
||||
onEditItem: handleEditItem,
|
||||
|
||||
@@ -155,6 +155,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'name',
|
||||
className: 'name',
|
||||
width: 180,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'code',
|
||||
@@ -162,6 +163,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'code',
|
||||
className: 'code',
|
||||
width: 120,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'type',
|
||||
@@ -169,6 +171,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: ItemTypeAccessor,
|
||||
className: 'item_type',
|
||||
width: 120,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'category',
|
||||
@@ -176,6 +179,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'category.name',
|
||||
className: 'category',
|
||||
width: 150,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'sell_price',
|
||||
@@ -183,6 +187,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'sell_price_formatted',
|
||||
className: 'sell-price',
|
||||
width: 150,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'cost_price',
|
||||
@@ -190,6 +195,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'cost_price_formatted',
|
||||
className: 'cost-price',
|
||||
width: 150,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'quantity_on_hand',
|
||||
@@ -197,6 +203,7 @@ export const useItemsTableColumns = () => {
|
||||
accessor: 'quantity_on_hand',
|
||||
Cell: QuantityOnHandCell,
|
||||
width: 140,
|
||||
clickable: true,
|
||||
},
|
||||
],
|
||||
[],
|
||||
|
||||
Reference in New Issue
Block a user