I would like to add the backGroundColor of the rows using the array so we can use the alternate row color for marking stuff and items in a very useful way.
const myTableData = [
{"name": "A", "num": 45, "#ffffff"},
{"name": "B", "num": 34, "#00ffff"},
{"name": "C", "num": 19, "#ffffff"},
{"name": "D", "num": 59, "#00ffff"},
{"name": "E", "num": 24, "#00ffff"},
{"name": "F", "num": 96, "#ffffff"}
];
And by setting that in the columns array the system would know to use it properly.
$w("#myTable").columns = [
{
"id": "col1",
"dataPath": "field1",
"label": "Field 1",
"width": 100,
"visible": true,
"type": "string",
"linkPath": "link-field-or-property"
},
{
"id": "col2",
"dataPath": "field2",
"label": "Field 2",
"width": 100,
"visible": true,
"type": "image",
"linkPath": "link-field-or-property"
},
{
"id": "col3",
"dataPath": "field3",
"label": "Field 3",
"width": 100,
"visible": true,
"type": "number",
"linkPath": "link-field-or-property"
},
{
"id": "col4",
"dataPath": "field4",
"label": "Field 4",
"width": 100,
"visible": true,
"type": "rowBackGroundColor", // This does it
"linkPath": "link-field-or-property",
}
];