@yuuvis/client-framework 2.8.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,9 +197,17 @@ class DataGridComponent {
197
197
  });
198
198
  this.#loadData = effect(() => {
199
199
  const formElement = this.formElement();
200
- const elements = formElement ? formElement['elements'] : [];
200
+ if (formElement && formElement['columnDefinitions']) {
201
+ // map columnDefinitions to elements for table rendering
202
+ formElement['elements'] = formElement['columnDefinitions'].map((colDef) => ({
203
+ ...colDef,
204
+ name: colDef.id,
205
+ label: this.#systemService.getLocalizedLabel(colDef.id) || colDef.id
206
+ }));
207
+ }
208
+ const elements = formElement ? formElement['elements'] || [] : [];
201
209
  let data = formElement ? formElement['value'] || [] : [];
202
- const columns = elements.map((e) => e.name);
210
+ const columns = elements.map((e) => e.name || e.id);
203
211
  data = data.map((row) => {
204
212
  if (Array.isArray(row)) {
205
213
  const obj = {};