# How to get the HTML Id of dashboard widgets/DIVs

**URL:** https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [27 July 2024 13:14 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815 "2024-07-27T13:14:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [27 July 2024 13:14 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/1 "2024-07-27T13:14:46Z")

</div>

I'm trying to create a "tabbed" dashboard page (a single page with internal tabs).  
I can easily do it with native HTML elements (defined in template nodes) which I can show/hide per the selected tab.

But is there a way to dynamically set the visibility of standard Dashboard-2.0 elements (ui-button, ui-text etc.), e.g. by getting their Id (or better still, the Id of their containing DIVs)?

I can always render the active tab into a `ui-iframe` node, but looking for something simpler.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [27 July 2024 16:01 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/2 "2024-07-27T16:01:35Z")

</div>

If you're open to contributing this to core, Id happily see this as one of our core offerings for a layout. I actually opened an issue for it this week:

> <https://github.com/FlowFuse/node-red-dashboard/issues/1119>
>
> \### Description
> 
> Rather than rendering groups side-by-side in a grid or masonry …layout (as per Fixed and Grid) and beneath each other (as per Notebook), a new layout option should be available to show content in Tabs.
> 
> Vuetify's "Tab" component would assist here: https://vuetifyjs.com/en/components/tabs/#usage
> 
> Each group on a given page would be a tab, and would take up the space available on the page.
> 
> \### Have you provided an initial effort estimate for this issue?
> 
> I have provided an initial effort estimate

Thinking that each group on the page would render as a tab

---

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [28 July 2024 10:09 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/3 "2024-07-28T10:09:14Z")

</div>

OK, so you just disclosed the simple & elegant solution.. 🙂. Define each tab content in its own group, and show/hide the groups with `ui-control` messages (of course, we should remember to set the `ui-control` for multi-tenant).

Yes, it would be great to have this as a new built-in layout. Once I find some free time I will be happy to contribute.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [28 July 2024 15:56 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/4 "2024-07-28T15:56:43Z")

</div>

Fancy a quick challenge, so going to see if I can get this started at least.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [28 July 2024 16:36 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/5 "2024-07-28T16:36:08Z")

</div>

Fun 40 minutes: [Layout: Tabs by joepavitt · Pull Request #1138 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/pull/1138)

---

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [28 July 2024 17:51 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/6 "2024-07-28T17:51:36Z")

</div>

This is great. Thanks Joe!  
Need to make sure that the tabbed dialog supports multi-tenant, i.e. that concurrent clients can be on different tabs

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [28 July 2024 18:00 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/7 "2024-07-28T18:00:06Z")

</div>

It does, tab state stays client-side only.

---

<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: [27 August 2024 18:00 UTC](https://discourse.nodered.org/t/how-to-get-the-html-id-of-dashboard-widgets-divs/89815/8 "2024-08-27T18:00:28Z")

</div>

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