Hello
I am using node-red-dashboard-2-table-tabulator v0.8.2 with nodered v4.1.0
I would like to add an icon in the first column of each row
Here is the configuration
{
"height": 200,
"layout": "fitColumns",
"columns": [
{"field":"id","visible":false},
{"title":"Name","field":"name","width":200,"hozAlign":"left"},
{"title":"Age","field":"gender","width": 100,"hozAlign":"center"},
{"formatter":"@F:printIcon", "width":50, "hozAlign":"center"}
]
}
function printIcon(cell, formatterParams, onRendered) {
return '';
};
I downloaded font-awesome to this place
.node-red\node_modules@omrid01\node-red-dashboard-2-table-tabulator\fontawesome\css
and I used ui-template with
What did I do wrong ?
Here is the full code
[
{
"id": "1de7e8489cf59eee",
"type": "tab",
"label": "Flux 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "41890ffcff95c8d4",
"type": "ui-tabulator",
"z": "1de7e8489cf59eee",
"name": "",
"group": "eb610579a53cbe25",
"initObj": "{\n \"height\": 200,\n \"layout\": \"fitColumns\",\n \"columns\": [\n {\"field\":\"id\",\"visible\":false},\n {\"title\":\"Name\",\"field\":\"name\",\"width\":200,\"hozAlign\":\"left\"},\n {\"title\":\"Age\",\"field\":\"gender\",\"width\": 100,\"hozAlign\":\"center\"},\n {\"formatter\":\"@F:printIcon\", \"width\":50, \"hozAlign\":\"center\"}\n ]\n}",
"funcs": "function printIcon(cell, formatterParams, onRendered) {\r\n return '<i class=\"fa fa-print\"></i>';\r\n};\r\n ",
"allowMsgFuncs": false,
"maxWidth": "",
"events": "",
"order": 1,
"multiUser": false,
"validateRowIds": false,
"themeCSS": "",
"themeFile": "",
"tblDivId": "",
"printToLog": false,
"width": 0,
"height": 0,
"x": 680,
"y": 480,
"wires": [
[]
]
},
{
"id": "a0d813a67eff96be",
"type": "inject",
"z": "1de7e8489cf59eee",
"name": "",
"props": [
{
"p": "tbCmd",
"v": "setData",
"vt": "str"
},
{
"p": "tbArgs",
"v": "[[{\"id\":1,\"name\":\"bob\",\"gender\":\"male\",\"icon\":\"\"},{\"id\":2,\"name\":\"Jenny\",\"gender\":\"female\",\"icon\":\"\"}]]",
"vt": "json"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 470,
"y": 480,
"wires": [
[
"41890ffcff95c8d4"
]
]
},
{
"id": "873bc3ebb23d8f11",
"type": "ui-template",
"z": "1de7e8489cf59eee",
"group": "",
"page": "8b265c748a7ac36e",
"ui": "",
"name": "",
"order": 0,
"width": 0,
"height": 0,
"head": "",
"format": "<template>\n<link rel=\"stylesheet\" href=\"/resources/@omrid01/node-red-dashboard-2-table-tabulator/font-awesome/css/font-awesome.min.css\">\n</template>\n",
"storeOutMessages": true,
"passthru": true,
"resendOnRefresh": true,
"templateScope": "page:style",
"className": "",
"x": 570,
"y": 420,
"wires": [
[]
]
},
{
"id": "eb610579a53cbe25",
"type": "ui-group",
"name": "Group 1",
"page": "8b265c748a7ac36e",
"width": 6,
"height": 1,
"order": 1,
"showTitle": true,
"className": "",
"visible": true,
"disabled": false,
"groupType": "default"
},
{
"id": "8b265c748a7ac36e",
"type": "ui-page",
"name": "Page 1",
"ui": "f2d3bbf8197fdaf7",
"path": "/page1",
"icon": "home",
"layout": "grid",
"theme": "2b094c35cd0cde05",
"breakpoints": [
{
"name": "Default",
"px": 0,
"cols": 3
},
{
"name": "Tablet",
"px": 576,
"cols": 6
},
{
"name": "Small Desktop",
"px": 768,
"cols": 9
},
{
"name": "Desktop",
"px": 1024,
"cols": 12
}
],
"order": 1,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "f2d3bbf8197fdaf7",
"type": "ui-base",
"name": "My Dashboard",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false,
"headerContent": "page",
"navigationStyle": "default",
"titleBarStyle": "default",
"showReconnectNotification": true,
"notificationDisplayTime": 1,
"showDisconnectNotification": true,
"allowInstall": false
},
{
"id": "2b094c35cd0cde05",
"type": "ui-theme",
"name": "Default Theme",
"colors": {
"surface": "#ffffff",
"primary": "#0094CE",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"density": "default",
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
},
{
"id": "f50b503f5c1c5cf1",
"type": "global-config",
"env": [],
"modules": {
"@omrid01/node-red-dashboard-2-table-tabulator": "0.8.2",
"@flowfuse/node-red-dashboard": "1.30.1"
}
}
]



