Ui-table in conjunction with ui-table handler

Hi .... Yes This can be done.

It was in my 1st table you can find in the examples. This is the HTML Version (look into column BOOST_STATE-value

image

but the more elegant way to do:

  • you will need a formatter callback more here
  • I use a function node as an editor and the copy paste it into the visual JSON editor (to escape all inverted commas) CTRL-A + CTRL-V
var customFormatter = function (cell, formatterParams, onRendered) {
    //cell - the cell component
    //formatterParams - parameters set for the column
    //onRendered - function to call when the formatter has been rendered

    let value = cell.getValue();
    let color = 'orange';
    if (value < 40) {
        color = 'red';
    } else if (value > 70) {
        color = 'green';
    }
    cell.getElement().style.color = color;

    return value;
}

copy everything from function ( ... } into the formatter value.

Tip: The callbacks are running in the dashboard / browser so use the development tools for debugging. simple console.log() might help for easy bugs

You can alter the DOM with the style object ... so a lot of possibilities!

Good night :wink: