mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Fix column width declarations
This commit is contained in:
parent
481258484c
commit
47ecbf0601
3 changed files with 5 additions and 5 deletions
|
|
@ -337,14 +337,14 @@ export const getColumnDef = (column: TableColumn) => {
|
|||
return tableColumns[column as keyof typeof tableColumns];
|
||||
};
|
||||
|
||||
export const getColumnDefs = (columns: PersistedTableColumn[]) => {
|
||||
export const getColumnDefs = (columns: PersistedTableColumn[], useWidth?: boolean) => {
|
||||
const columnDefs: ColDef[] = [];
|
||||
for (const column of columns) {
|
||||
const presetColumn = tableColumns[column.column as keyof typeof tableColumns];
|
||||
if (presetColumn) {
|
||||
columnDefs.push({
|
||||
...presetColumn,
|
||||
initialWidth: column.width,
|
||||
[useWidth ? 'width' : 'initialWidth']: column.width,
|
||||
...column.extraProps,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue