mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
BC-12 feat: table rows and cells clickable.
This commit is contained in:
@@ -76,6 +76,10 @@ function AccountsDataTable({
|
||||
accountType: account.account_type,
|
||||
});
|
||||
};
|
||||
// Handle cell click.
|
||||
const handleCellClick = (cell, event) => {
|
||||
openDrawer('account-drawer', { accountId: cell.row.original.id });
|
||||
};
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
@@ -103,6 +107,7 @@ function AccountsDataTable({
|
||||
// #TableVirtualizedListRows props.
|
||||
vListrowHeight={42}
|
||||
vListOverscanRowCount={0}
|
||||
onCellClick={handleCellClick}
|
||||
payload={{
|
||||
onEdit: handleEditAccount,
|
||||
onDelete: handleDeleteAccount,
|
||||
|
||||
@@ -56,6 +56,7 @@ export const useAccountsTableColumns = () => {
|
||||
accessor: 'name',
|
||||
className: 'account_name',
|
||||
width: 200,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'code',
|
||||
@@ -63,6 +64,7 @@ export const useAccountsTableColumns = () => {
|
||||
accessor: AccountCodeAccessor,
|
||||
className: 'code',
|
||||
width: 80,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'type',
|
||||
@@ -70,6 +72,7 @@ export const useAccountsTableColumns = () => {
|
||||
accessor: 'account_type_label',
|
||||
className: 'type',
|
||||
width: 140,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'normal',
|
||||
@@ -78,12 +81,14 @@ export const useAccountsTableColumns = () => {
|
||||
accessor: 'account_normal',
|
||||
className: 'normal',
|
||||
width: 80,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'currency',
|
||||
Header: intl.get('currency'),
|
||||
accessor: 'currency_code',
|
||||
width: 75,
|
||||
clickable: true,
|
||||
},
|
||||
{
|
||||
id: 'balance',
|
||||
@@ -91,6 +96,7 @@ export const useAccountsTableColumns = () => {
|
||||
accessor: 'amount',
|
||||
Cell: BalanceCell,
|
||||
width: 150,
|
||||
clickable: true,
|
||||
},
|
||||
],
|
||||
[],
|
||||
|
||||
@@ -51,7 +51,6 @@ function GeneralFormPage({
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
setSubmitting(false);
|
||||
resetForm();
|
||||
};
|
||||
// Handle request error.
|
||||
const onError = (errors) => {
|
||||
|
||||
Reference in New Issue
Block a user