Using callback and formatter with ui-etable

I am pulling data from SQL and putting into an etable. I've managed to get the data into the table and make it editable. In my case, I'm working with numbers, so I'm using "editor" : "number" for the columns I want to edit. I want to use the callback "cellEdited" to change the color of the text I just changed, but I can't seem to get it to work. I haven't figured out how to format to use a function.

If I use a change node with msg.ui_control in front of a regular table node, I can get the text to change based on a limit. For example, if cell value > 3, cell.getElement().style.color = 'yellow', but I can't even make this work in the etable.

Any help toward understanding the tabulator syntax would be appreciated.

[{"id":"62cfe956795419b3","type":"inject","z":"8b337c9b6fd61f73","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"Size\":1,\"JRNY_II_CR\":1,\"BCS\":1,\"PS\":null,\"CR/PS\":null,\"CONST\":null},{\"Size\":2,\"JRNY_II_CR\":1,\"BCS\":1,\"PS\":null,\"CR/PS\":1,\"CONST\":null},{\"Size\":3,\"JRNY_II_CR\":2,\"BCS\":2,\"PS\":1,\"CR/PS\":3,\"CONST\":null},{\"Size\":4,\"JRNY_II_CR\":2,\"BCS\":5,\"PS\":1,\"CR/PS\":5,\"CONST\":1},{\"Size\":5,\"JRNY_II_CR\":2,\"BCS\":5,\"PS\":1,\"CR/PS\":6,\"CONST\":1},{\"Size\":6,\"JRNY_II_CR\":2,\"BCS\":4,\"PS\":1,\"CR/PS\":6,\"CONST\":1},{\"Size\":7,\"JRNY_II_CR\":1,\"BCS\":3,\"PS\":1,\"CR/PS\":4,\"CONST\":1},{\"Size\":8,\"JRNY_II_CR\":2,\"BCS\":1,\"PS\":1,\"CR/PS\":1,\"CONST\":1},{\"Size\":9,\"JRNY_II_CR\":1,\"BCS\":1,\"PS\":null,\"CR/PS\":1,\"CONST\":null},{\"Size\":10,\"JRNY_II_CR\":1,\"BCS\":1,\"PS\":null,\"CR/PS\":null,\"CONST\":null}]","payloadType":"json","x":270,"y":720,"wires":[["b4b939d9b39b9945"]]},{"id":"b4b939d9b39b9945","type":"ui_etable","z":"8b337c9b6fd61f73","payload":"[{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"Size\",\"field\":\"Size\",\"frozen\":true,\"width\":75,\"headerSort\":false},{\"formatterParams\":{\"target\":\"_blank\",\"min\":0,\"max\":10,\"color\":[\"green\",\"yellow\",\"red\"]},\"title\":\"JRNY_II_CR\",\"field\":\"JRNY_II_CR\",\"align\":\"center\",\"width\":150,\"headerSort\":false,\"editor\":\"number\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"BCS\",\"field\":\"BCS\",\"align\":\"center\",\"width\":75,\"headerSort\":false,\"editor\":\"number\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"PS\",\"field\":\"PS\",\"align\":\"center\",\"width\":75,\"headerSort\":false,\"editor\":\"number\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"CR/PS\",\"field\":\"CR/PS\",\"align\":\"center\",\"width\":75,\"headerSort\":false,\"editor\":\"number\"},{\"formatterParams\":{\"target\":\"_blank\"},\"title\":\"CONST\",\"field\":\"CONST\",\"align\":\"center\",\"width\":75,\"headerSort\":false,\"editor\":\"number\"}]","payloadType":"json","options":"{\"movableColumns\":false,\"resizableColumns\":false,\"autoResize\":true,\"responsiveLayout\":\"collapse\",\"layout\":\"fitColumns\",\"hozAlign\":\"center\",\"selectable\":\"true\"}","group":"2d64f6bc612917ea","name":"Table 1","order":1,"width":15,"height":7,"columns":[],"outputs":1,"cts":false,"x":420,"y":760,"wires":[["bfeb756ca69ce443","5eb2424871234f8f"]]},{"id":"bfeb756ca69ce443","type":"function","z":"8b337c9b6fd61f73","name":"context","func":"var rack = flow.get(\"racks01\")\nvar index = msg.payload.Size - 1\n\nrack[index] = msg.payload\nflow.set(\"racks01\", rack)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":760,"wires":[[]]},{"id":"5eb2424871234f8f","type":"debug","z":"8b337c9b6fd61f73","name":"debug 10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":700,"y":720,"wires":[]},{"id":"2d64f6bc612917ea","type":"ui_group","name":"Knee Rack Inventory","tab":"5cf832f9eb423b4e","order":1,"disp":true,"width":30,"collapse":false,"className":""},{"id":"5cf832f9eb423b4e","type":"ui_tab","name":"Knee Racks","icon":"dashboard","order":12,"disabled":false,"hidden":false}]

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