@Christian-Me Could I get a little nudge to point me in the right direction please?
Have now got a message that includes the row number on each click.
But I am unclear how to send it back to the table node...
Here is the code and the debug message.
Here is how I have the flow setup to catch every click on the table.
Thanks.
EDIT. Never mind. Refresh the browser and its working.
For those following along, this will highlight the selected row in a table.
To recap....
Second Edit based on Christian-Me extra info a few posts down..
The ui control node does not output anything (as per dceejay post just above this one) so does not need to be hooked to anything.
Install the correct table node. You want node-red-node-ui-table.
Place a ui control node on the flow, select 'Change tab or group events only' from the drop down menu.
Place a function node on your flow.
The function node code is as follows. (Just cut and paste it all in).
Your select row function node does NOT select a row! It only aktivate the selection feature of ui-table!
to select a row you have to send the selectRow(yourID) to ui_table
your ui-control node does nothing to your flow (not wired to anything). Suggestion:
Just to make this clear. The command is only needed if you wish to select a row by Node-RED to highlight a value change for example. There is no need to "send it back".
Thanks for the extra info. I have edited my post above to reflect your input.
The ui control does not output anything (for the table row selection) so does not need to be connected to anything - since its not sending a message.
I think the main difference is that I only wanted to highlight the row, not do anything with the data (its already sent to the template node on selection).
The idea of the ui-control node is to inject the ui_control message (to activate selection) once a browser connects or a tab is changed: (This is what happens on reload: First lost, then reconnect and then the tab is activated = change)
So change should work but you are right on deploy of modified nodes this does not happen (allways). in your flow the first click on a row sends the "default" message and then your select row function is triggered activating the select mode. I assume that a selection only works on the second click after deploy. I use a inject node and the ui_control node combined to send all configurations.