From f225266edb8006c05b6ea9058d6d96f9927f6559 Mon Sep 17 00:00:00 2001 From: Satbir Singh Date: Thu, 31 Oct 2019 11:13:59 +0000 Subject: [PATCH] Table will construct columns based on all data --- app/client/src/widgets/TableWidget.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/src/widgets/TableWidget.tsx b/app/client/src/widgets/TableWidget.tsx index d2cc0bb52f..5e37fc189b 100644 --- a/app/client/src/widgets/TableWidget.tsx +++ b/app/client/src/widgets/TableWidget.tsx @@ -15,7 +15,11 @@ interface Column { function constructColumns(data: object[]): Column[] { let cols: Column[] = []; - forIn(data[0], (value, key) => { + let listItemWithAllProperties = {} + data.forEach(dataItem => { + Object.assign(listItemWithAllProperties, dataItem) + }) + forIn(listItemWithAllProperties, (value, key) => { cols.push({ key: key, dataKey: key,