Merge branch 'feature/table-component' into 'release'

Table will construct columns based on all data

See merge request theappsmith/internal-tools-client!102
This commit is contained in:
Nikhil Nandagopal 2019-10-31 11:13:59 +00:00
commit 765f6f3d07

View File

@ -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,