I just created a bare-bones example.
Sample view with a table. Note, in the table's columns
property, how the Value
column's render
is set to view
:
{
"custom": {},
"params": {},
"props": {},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Table1"
},
"position": {
"basis": "400px",
"grow": 1
},
"propConfig": {
"custom.filtered": {
"access": "PRIVATE"
},
"custom.filteredDS": {
"access": "PRIVATE"
},
"custom.rawData": {
"access": "PRIVATE"
}
},
"props": {
"columns": [
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "Name",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"justify": "auto",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"max": 100,
"min": 0,
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"render": "auto",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": true,
"width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "Value",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"justify": "auto",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"max": 100,
"min": 0,
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"render": "view",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "TagColumn",
"visible": true,
"width": ""
}
],
"data": {
"$": [
"ds",
192,
1690756907117
],
"$columns": [
{
"data": [
"Gateway CPU",
"Gateway RAM"
],
"name": "Name",
"type": "String"
},
{
"data": [
"[default]Forum/GatewayCPU",
"[default]Forum/GatewayMemory"
],
"name": "Value",
"type": "String"
}
]
},
"pager": {
"bottom": false
}
},
"type": "ia.display.table"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "34px",
"grow": 1
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}
The above table uses this as the rendering view for the column. Note that the value
passed into this view is the tagpath from the Value
column:
{
"custom": {
"fmt": "#,##0.000",
"tag": 0.01669449081803005
},
"params": {
"row": "value",
"rowIndex": "value",
"value": "[default]Forum/GatewayCPU"
},
"propConfig": {
"custom.fmt": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.value}"
},
"tagPath": "{1}.FormatString"
},
"type": "tag"
},
"persistent": true
},
"custom.tag": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.value}"
},
"tagPath": "{1}"
},
"type": "tag"
},
"persistent": true
},
"params.row": {
"paramDirection": "input",
"persistent": true
},
"params.rowIndex": {
"paramDirection": "input",
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 42,
"width": 233
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "32px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "numberFormat({view.custom.tag}, {view.custom.fmt})"
},
"type": "expr"
}
}
},
"props": {
"style": {
"textAlign": "right"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"paddingLeft": "0.5em",
"paddingRight": "1em"
}
},
"type": "ia.container.flex"
}
}
Adjust your source dataset for the table as desired.
Note that the rendering view only handles numbers, and expects the tag to have a valid .FormatString
. Fortunately, numeric tags have valid default format strings.