diff --git a/packages/nc-gui/composables/useViewAggregate.ts b/packages/nc-gui/composables/useViewAggregate.ts index 6357fd555e..a885510122 100644 --- a/packages/nc-gui/composables/useViewAggregate.ts +++ b/packages/nc-gui/composables/useViewAggregate.ts @@ -38,7 +38,7 @@ const [useProvideViewAggregate, useViewAggregate] = useInjectionState( field: gridField, column: f.field, index: f.index, - width: `${Number(gridField.width.replace('px', ''))}px` || '180px', + width: `${Number((gridField.width ?? '').replace('px', ''))}px` || '180px', } }) }) @@ -116,6 +116,8 @@ const [useProvideViewAggregate, useViewAggregate] = useInjectionState( const fieldAggregateMapping = _fields.field.reduce((acc, field) => { const f = fields.value.find((f) => f.title === field) + if (!f?.id) return acc + acc[f.id] = gridViewCols.value[f.id].aggregation ?? CommonAggregations.None return acc