Add persisted width on colDef generator
This commit is contained in:
parent
552ad1b2a6
commit
b9a03fc412
1 changed files with 8 additions and 3 deletions
|
@ -217,10 +217,15 @@ export const getColumnDef = (column: TableColumn) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getColumnDefs = (columns: PersistedTableColumn[]) => {
|
export const getColumnDefs = (columns: PersistedTableColumn[]) => {
|
||||||
const columnDefs: any[] = [];
|
const columnDefs: ColDef[] = [];
|
||||||
for (const column of columns) {
|
for (const column of columns) {
|
||||||
const columnExists = tableColumns[column.column as keyof typeof tableColumns];
|
const presetColumn = tableColumns[column.column as keyof typeof tableColumns];
|
||||||
if (columnExists) columnDefs.push(columnExists);
|
if (presetColumn) {
|
||||||
|
columnDefs.push({
|
||||||
|
...presetColumn,
|
||||||
|
width: column.width,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return columnDefs;
|
return columnDefs;
|
||||||
|
|
Reference in a new issue