Examples for node-red-node-ui-table

Yes ... isn't too difficult. You need a callback function to send the edited data back to Node-RED. Best is to define one for the hole table independent of the type of editor defined for the column:

msg.ui_control.tabulator.cellEdited.

function(cell){     
    this.send({
        ui_control:{callback:'cellEdited'},         
        payload:cell.getValue(),
        oldValue:cell.getOldValue(),
        field:cell.getColumn().getField(),
        id:cell.getRow().getCell('id').getValue()
    }); 
}

Then you only have to define the editor type for every column you want to have the edit feature enabled like msg.ui_control.tabulator.colums[{field:'yourColum',editor:'input'}]

If you need some kind on validation you perhaps write individual cellEdited functions for each column.

ui-table node will send a message for every edited field containing the row (id or any other index), the column (field), new and old value.

3 Likes