I am trying to change color of a button. I'm injecting msg.ui_update.buttonColor = 'red';.
But it seems to be not working. What am I doing wrong here ?
[
{
"id": "1df2f5078ba20e02",
"type": "tab",
"label": "Flow 4",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e0e370a0492f92f2",
"type": "ui-button",
"z": "1df2f5078ba20e02",
"group": "93f9aaa4d3dd3be5",
"name": "",
"label": "xxxxx",
"order": 2,
"width": "3",
"height": "2",
"emulateClick": false,
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "mdi-robot-confused",
"iconPosition": "left",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"buttonColor": "",
"textColor": "",
"iconColor": "",
"enableClick": true,
"enablePointerdown": false,
"pointerdownPayload": "",
"pointerdownPayloadType": "str",
"enablePointerup": false,
"pointerupPayload": "",
"pointerupPayloadType": "str",
"x": 590,
"y": 60,
"wires": [
[]
]
},
{
"id": "5dc0e9d6bd22abf5",
"type": "function",
"z": "1df2f5078ba20e02",
"name": "function 3",
"func": "msg.ui_update.buttonColor = 'red';\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 420,
"y": 60,
"wires": [
[
"e0e370a0492f92f2",
"39a013bc46edca06"
]
]
},
{
"id": "8ea249744859fe3a",
"type": "inject",
"z": "1df2f5078ba20e02",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 220,
"y": 60,
"wires": [
[
"5dc0e9d6bd22abf5"
]
]
},
{
"id": "39a013bc46edca06",
"type": "debug",
"z": "1df2f5078ba20e02",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 120,
"wires": []
},
{
"id": "93f9aaa4d3dd3be5",
"type": "ui-group",
"name": "Group 1",
"page": "94179d55f06e9dc9",
"width": "10",
"height": "6",
"order": 1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "94179d55f06e9dc9",
"type": "ui-page",
"name": "Page 1",
"ui": "aa4a481102980b53",
"path": "/page1",
"icon": "home",
"layout": "flex",
"theme": "e553d4d8b2fc2ad7",
"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": "aa4a481102980b53",
"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
},
{
"id": "e553d4d8b2fc2ad7",
"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"
}
}
]