UI TAble getRow

Goodmorning, I'm working with ui_tabel and I can correctly deleteRow with function node as follow:

msg.payload = {
command:"deleteRow",
arguments: [id],
returnPromise: true
}
node.send(msg);

However, if I try with getRow as follow:

msg.payload = {
command:"getRow",
arguments: [id],
returnPromise: true
}
node.send(msg);

It doesn't work. How is it possible?
Thanks in advanced.

The ui_table has this checkbox

image

it will return the clicked row at the output of the node

Hello @UnborN ,
thank you very much for your answer. Actually I have Send data on click checked but it doesn't work.
Please check the following flow:

[{"id":"ffa37464.7197b","type":"function","z":"f8df640c.6a046","name":"table parameter","func":"msg.ui_control = {\n    \"customHeight\":12,\n    \"tabulator\": {\n        \"selectable\":true,\n        \"movableColumns\": false,\n        \"autoColumns\": true,\n        \"selectableRangeMode\": \"click\",\n        //\"cellEdited\":\"function(cell) {var change = {newValue:cell.getValue()}; this.send({topic:this.config.topic,ui_control:{callback:'cellEdited',changes:change, id:cell.getRow().getCell('address').getValue()}});}\",\n        //\"renderComplete\":\"function() {this.send({ui_control:{callback:'renderComplete'}})}\",\n        \"rowSelectionChanged\":\"function(data, rows) {\" + \n            \"var selectedRows = []; rows.forEach(function(row) {selectedRows.push(row.getData());});\" +\n            \"this.send({topic: this.config.topic, payload: data, selectedRows: selectedRows, ui_control: {callback: 'rowSelectionChanged'}});}\",\n        \"columns\":[\n            {\n                \"field\": \"id\",\n                \"title\": \"Address\",\n                \"visible\": false,\n                \"resizable\":false\n            },\n            {\n                \"field\": \"machineType\",\n                \"title\": \"Machine Type\",\n                \"resizable\":false\n            }\n        ],\n        \"data\":[\n\t        {id:1, machineType:\"V300\"}\n        ]\n    },\n};\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":720,"wires":[["8c533146.360d1"]],"info":"\nif (msg.hasOwnProperty('ui_control') && msg.ui_control.callback === \"renderComplete\") {\n    var msgOut={\n        payload:{\n            command:\"selectRow\",\n            arguments: [1],\n            returnPromise: false\n        }\n    }\n    return msgOut;\n}"},{"id":"b47ec933.5ea67","type":"debug","z":"f8df640c.6a046","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":920,"wires":[]},{"id":"57b58021.1bc8f","type":"function","z":"f8df640c.6a046","name":"UnconnectedListOperations","func":"\nmsg.payload = {\n    command: \"getRow\",\n    arguments: [1],\n    returnPromise: true\n};\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":780,"wires":[["8c533146.360d1","b47ec933.5ea67"]]},{"id":"5a358068.ea7b38","type":"inject","z":"f8df640c.6a046","name":"Populate","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":720,"wires":[["ffa37464.7197b"]]},{"id":"32acbf9b.939fd","type":"inject","z":"f8df640c.6a046","name":"Command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":780,"wires":[["57b58021.1bc8f"]]},{"id":"8c533146.360d1","type":"ui_table","z":"f8df640c.6a046","group":"8f6d5436.0e2ac","name":"Node","order":2,"width":"4","height":"5","columns":[{"field":"id","title":"Address","width":"","align":"center","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"machineType","title":"Machine Type","width":"","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":1,"cts":true,"x":670,"y":780,"wires":[["b47ec933.5ea67"]]},{"id":"8f6d5436.0e2ac","type":"ui_group","name":"UnconnectedNode","tab":"afe6a11e.75bc5","order":1,"disp":true,"width":"4","collapse":false},{"id":"afe6a11e.75bc5","type":"ui_tab","name":"Database","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Thank you again.

That's what I get when clicking into the table:

Do you expect something else?

Hello @ralphwetzel ,
thank you for your answer. I could be wrong, but as far as I can tell you get this result clicking on the column "Machine Type". Instead I'd like to get data value, pressing the inject "Command" which calls the function getRow. Can you confirm me that you clicked on the table, instead of the inject "Command"?
Thank you again.

hmm .. dont know why getRow doesnt work .. i tested a few combinations
selectRow seems to be ok if that helps

msg.payload = {
    command: "selectRow",
    arguments: [1],
    returnPromise: true
};

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