mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Add persisted width on colDef generator
This commit is contained in:
@@ -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 New Issue
Block a user