mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue