Added the ability to resize columns on dashboard tables. Fixes #7364

This commit is contained in:
Pradip Parkale
2022-05-18 17:49:54 +05:30
committed by Akshay Joshi
parent 5e0dfff42a
commit 11cfea3860
5 changed files with 72 additions and 80 deletions

View File

@@ -291,6 +291,7 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
// Let's make a column for selection
{
id: 'selection',
resizable: false,
// The header can use the table's getToggleAllRowsSelectedProps method
// to render a checkbox
Header: ({ getToggleAllRowsSelectedProps, toggleRowSelected, isAllRowsSelected, rows }) => {
@@ -343,11 +344,6 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
return [...CLOUMNS];
}
});
hooks.useInstanceBeforeDimensions.push(({ headerGroups }) => {
// fix the parent group of the selection button to not be resizable
const selectionGroupHeader = headerGroups[0].headers[0];
selectionGroupHeader.resizable = false;
});
}
);
@@ -486,13 +482,13 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
: ' 🔼'
: ''}
</span>
{column.resizable && (
<div
{...column.getResizerProps()}
className={classes.resizer}
/>
)}
</div>
{column.resizable && (
<div
{...column.getResizerProps()}
className={classes.resizer}
/>
)}
</div>
))}
</div>