# Ui-table Need help

**URL:** <https://discourse.nodered.org/t/ui-table-need-help/87183>\
**Category:** General\
**Tags:** node-red-dashboard, ui-template\
**Created:** [12 April 2024 08:11 UTC](https://discourse.nodered.org/t/ui-table-need-help/87183 "2024-04-12T08:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larspalmqvistdk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/larspalmqvistdk/32/39282_2.png) [@Larspalmqvistdk](https://discourse.nodered.org/u/Larspalmqvistdk)\
**Post date:** [12 April 2024 08:11 UTC](https://discourse.nodered.org/t/ui-table-need-help/87183/1 "2024-04-12T08:11:48Z")

</div>

Hi i need serius help now, before i loose my sanity. i have a flow with two function nodes one sends msg.ui-control for setting up a tabulator table. that works fine . the other sends am objectarray for data, and that is displayed fine, the probleme comes when i need to convart data in a cell based on the showed params, i have attached function node configuration. i am general in doubt where to put code for farmattin the table and also callback when i click a cell. please pin it out for a dumas :-).

```auto
function customFormatter(cell, formatterParams, onRendered) {
    // Your formatter logic here
    return "Formatted Value"; // Replace "Formatted Value" with your actual formatted value
}
msg.ui_control = 
    {
        
   tabulator: {
        columnResized: "function(column){ var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }",
            columnMoved: "function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.field}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }",
                groupHeader: "function (value, count, data, group) {return value + \"<span style='color:#d00; margin-left:10px;'>(\" + count + \" Termostat\"+((count>1) ? \"e\" : \"\") + \")</span>\";}",
                    columns: [
                        {
                            formatterParams: {
                                target: "_blank"
                            },
                            title: "Header",
                            field: "Header",
                            width: 100,
                            frozen: true
                        },
                        {
                            formatterParams: {
                                
                                ranges: [
                                    { "min": 153910001, "max": 153905000, "text": "EcHo Plus DK WH" },
                                    { "min": 154000000, "max": 154005000, "text": "EcHo Plus EU WH" },
                                ]
                            },
                            title: "S.nr",
                            field: "SN",
                            width: 100,
                            align: "center",
                            formatter: function(cell, formatterParams) { 
                                console.log('Formatter function called'); 
                                var serialNumber = cell.getValue(); 
                                var match = serialNumber.toString().match(/\\d{2}(\\d+)/); 
                                if (match) { 
                                    var digitsAfterFirstTwo = parseInt(match[1]); 
                                    for (let range of formatterParams.ranges) { 
                                        if (digitsAfterFirstTwo >= range.min && digitsAfterFirstTwo <= range.max) { 
                                            return range.text; 
                                        } 
                                    } 
                                } 
                            return serialNumber+"lp"; 
                            }          
                        },
                        {
                            formatterParams: {
                                "target": "_blank"
                            },   
                            title: "Location ",
                            field: "unitloc",
                            width: 100,
                            align: "left",
                            formatter: function(cell, formatterParams){return cell.getValue()+"°C";}
                            
                        },
                       
                        {
                            formatterParams: {
                                target: "_blank"
                            },
                            title: "SWver",
                            field: "SWver",
                            width: 100,
                            align: "center"
                        },
                        {
                            formatterParams: {
                                target :"_blank"
                            },
                            title: "HWV",
                            field: "HWV",
                            width: 100,
                            align: "center"
                        },
                        {
                            formatterParams: {
                                target: "_blank"
                            },
                            title: "Network",
                            "columns": [
                                {
                                    formatterParams: {
                                        target: "_blank"
                                    },
                                    title: "IP",
                                    field: "IP",
                                    width: 125
                                },
                                {
                                    formatterParams: {
                                        target: "_blank"
                                    },
                                    title: "DHCP",
                                    field: "DHCP",
                                    width: 125
                                }
                            ]
                        },
                        {
                            formatterParams: {
                                target: "_blank"
                            },
                            title: "Projector timers Settings",
                            columns: [
                                {
                                formatterParams: {
                                        target: "_blank"
                                    },
                                    title: "Lamp timer",
                                    field: "TimerVal",
                                    width: 150
                                },
                                {
                                    formatterParams: {
                                        target: "_blank"
                                    },
                                    title: "Filter timer",
                                    field: "FilterTimer",
                                    width: 150,
                                    align: "center"
                                }
                            ]
                        },
                        {
                        formatterParams: {
                                "target": "_blank"
                            },
                            title: "Panel description ",
                            field: "UnitDSC",
                            width: 250,
                            align: "left"
                        }
                    ],
                        layout: "fitColumns",
                            movableColumns: true,
                                "groupBy": ""
    },
    "customHeight": 25
}

return msg;

```

---

<div class="post-metadata">

**Author:** ![Larspalmqvistdk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/larspalmqvistdk/32/39282_2.png) [@Larspalmqvistdk](https://discourse.nodered.org/u/Larspalmqvistdk)\
**Post date:** [13 April 2024 06:07 UTC](https://discourse.nodered.org/t/ui-table-need-help/87183/2 "2024-04-13T06:07:58Z")

</div>

Ive got it to work thaks if any answers

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 April 2024 06:08 UTC](https://discourse.nodered.org/t/ui-table-need-help/87183/3 "2024-04-27T06:08:39Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
