Skip to content

Commit 2267cea

Browse files
committed
LKE allow column name in table to include dots
1 parent 70da6c8 commit 2267cea

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

public/js/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ function getTableStructure(schemaStructure) {
338338
}
339339
return {
340340
title: property.propertyKey,
341-
field: property.propertyKey,
341+
// replace to avoid error in Tabulator
342+
field: property.propertyKey.replace(/\./g, 'dot'),
342343
align: align,
343344
titleFormatter: truncateTableText,
344345
headerSort: false,
@@ -368,6 +369,12 @@ function getTableData(queryResult) {
368369
item.data.properties[key] = value.value || value.original;
369370
}
370371
}
372+
// If one of the property key has a . we replace it by the string 'dot' to avoid an error in Tabulator
373+
if (key.includes('.')) {
374+
Object.defineProperty(item.data.properties, key.replace(/\./g, 'dot'),
375+
Object.getOwnPropertyDescriptor(item.data.properties, key));
376+
delete item.data.properties[key];
377+
}
371378
}
372379
return {...item.data.properties, 'id': item.id, 'row': index + 1};
373380
});

0 commit comments

Comments
 (0)