I’m curious if when defining columns for a TreeTable, can item attributes be accessed for a column, or only direct properties at the item level. (Not sure if I working that correctly)
As an example, for each item, I’ve got a “rec” attribute, which contains multiple values. so I would like to specify something like id=“rec.Name” as a column Id and it use the appropriate value :
Example JSON:
[
{
"id": "0013700000ARzs3AAD",
"rec": {
"attributes": {
"type": "Account",
"url": "/services/data/v43.0/sobjects/Account/001XXXXXXXXXXXXXX"
},
"Id": "001XXXXXXXXXXXXXX",
"Name": "TEST ACCOUNT 1",
"AccountNumber": "0000123456"
},
"data": [
{
"id": "0013700000ARwKtAAL",
"rec": {
"attributes": {
"type": "Account",
"url": "/services/data/v43.0/sobjects/Account/001XXXXXXXXXXXXX"
},
"Id": "001XXXXXXXXXXXXX",
"Name": "CHILD ACCOUNT 1",
"AccountNumber": "0000222222"
},
"data": []
}
]
}
]
I’d like to set up columns like and have it work properly:
columns:[
{ id:"rec.Name", header:"Name", width:250,
template:"{common.space()}{common.icon()}{common.treecheckbox()}{common.folder()}#value#"},
{ id:"id", header:"Id", width:200}
]
However at the moment it is just coming back as undefined for the column values.