The feature is called „select“ row! And it is included in the last example. Here is the doc:
Think setting “selectable“:1 should highlight only the last selected row.
@dceejay I mentioned it a while ago that there is no limit for the widget hight if set to auto in ui-table hight always = amount of rows. Do you think a limit is usefull? I never use auto so I don‘t care
msg.ui_control.tabulator[selectable]=1;
is throwing; "TypeError: Cannot read property 'tabulator' of undefined"
So yeah, its very confusing for a low-code guy like me.... will keep chipping at it, hopefully will get something we can post here for others.
"change tab or ..." is the right option, You can see the output in the demo flow (on the dashboard and with the debug nodes. Every row click send a standard message. if you need other function you have to write your own callback function
For those following along or finding this via a search.. After more than a few hours work I have had to give up and move on.
The ui control node just does not output anything (ever), so thus I cant detect a table row selection.
Such is life.
Thanks everyone for you help.
Making the table shorter makes a big usability improvement to the system.
eh ? that doesn't compute - the ui_control node will provide a change event every time the dashboard connects or changes tab (or every deploy)... the ui_table node provides events when you click on a row.
What is being suggested is to use the ui_control change event to provide an input to the table to tell it to be selectable. - You also then need to catch any select event from the table and save it so that it know which row was selected, so you can then feed that back in on next change, etc.
I have been using Node-RED for over 5 years and have a bizillian hours into this project and honestly, this is the first time it just flat out has not worked... no errors, and no debug messages. It just simply does not do anything.
You can click that row all you like and nothing will ever get detected.
The only time you get a debug message is when you change tabs in the dashboard.
At first I thought it was because I was using the wrong ui table node.
I had node-red-ui-node-table nodes installed. So I exported everything, uninstalled that node and installed
node-red-node-ui-table and reimported all my tables (that took about an hour).
Here is the table node I am now using.
@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).