Ui-table, msg.ui_control formatters

Finally found an example that I was able to make sense of. Or maybe taking a break and coming back to it and the formatters and examples are clearer to me.. either way. this works
CleanShot 2023-04-22 at 23.01.01

msg.ui_control = {
    tabulator: {
        headerVisible: false,
        rowFormatter: (function (row) {
            const data = row.getData();
            if (data.vals) {
                row.getElement().style.backgroundColor = 'red';
            } else {
                row.getElement().style.backgroundColor = '';
            }
        }).toString(),
        columns: [
            {
                field: "vals",
                width: "30%",
                editor: false,
            }
        ]
    }
};

msg.payload = null;
node.send(msg);
return;
2 Likes