# Can the table scroll UNDER a template?

**URL:** <https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929>\
**Category:** Dashboard\
**Created:** [10 January 2021 21:58 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929 "2021-01-10T21:58:29Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [12 January 2021 15:10 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/22 "2021-01-12T15:10:27Z")

</div>

@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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/f/9fa2af090813c3da1a4f68f9fbc8cb9133e613ce.png)

Here is how I have the flow setup to catch every click on the table.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/8544f1a29599e5beda1316567ff9a062a9af695a.png)

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.

1. Install the correct table node. You want `node-red-node-ui-table`.
2. Place a ui control node on the flow, select 'Change tab or group events only' from the drop down menu.
3. Place a function node on your flow.
4. The function node code is as follows. (Just cut and paste it all in).

```auto
msg.ui_control = {tabulator:{}};

msg.ui_control.tabulator.selectable=1;

return msg;

```

1. Deploy and refresh your browser.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 January 2021 16:13 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/23 "2021-01-12T16:13:02Z")

</div>

In the documents you find how to select rows ([Tabulator](http://tabulator.info/docs/4.4/select))

So it is a "command" or procedure call done by sending a object to ui\_table:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/46b5c26aea5e24f6501acd8b1539f631c80139af.png)

A Function node prepares the object and sets msg.row as the parameter for `selectRow`

```auto
msg.payload={
    "command": "selectRow",
    "arguments": [
        msg.row
    ],
    "returnPromise": false
}
return msg;

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/43dfe919ac80b8f073fa0f0e247472855b8ecce4.png)

You find more info in the help panel or in the readme.md of ui\_table  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1c2dc118583f9c4f9bb3806707667d6b597d6252.png)

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 January 2021 16:20 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/24 "2021-01-12T16:20:13Z")

</div>

Some thoughts!

- 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: ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d1e4ada4a394eb8b995664a5827de4783499dd8e.png)

> [@thebaldgeek](#):
>
> But I am unclear how to send it back to the table node...

- 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". 😉

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 January 2021 16:22 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/25 "2021-01-12T16:22:51Z")

</div>

and trigger all ui-controll events should avoid browser refresh. perhaps check with your debug node if the ui\_controll message is sent after deploy

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/4200dd44cf900ff998207042efd0c92093f607e3.png)

---

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [12 January 2021 16:31 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/26 "2021-01-12T16:31:57Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 January 2021 16:40 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/27 "2021-01-12T16:40:54Z")

</div>

> [@thebaldgeek](#):
>
> 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.

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)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6fb8a7b1da0d7399f2c162c8419e566d5256288.png)

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 February 2021 16:41 UTC](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929/28 "2021-02-11T16:41:16Z")

</div>

Closed on 11 February 2021 16:41 UTC

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

[Previous page](https://discourse.nodered.org/t/can-the-table-scroll-under-a-template/38929.md?page=1)
