Can you change tabs by clicking something within a page

I've looked but haven't been able to find a way to add a component (aka button) to a page so when you click it, it switches to one of the other pages/tabs. Does this capability exist within NR?

Hi @k5map

Just to clarify, is this with the node-red-dashboard set of nodes? If not, can you say a bit more about what page you want to add a button to?

@knolleary ... my bad for not clarifying... Yes, I was asking about this capability within the dashboard.

I don't have an example I can immediately share, but I can give you a couple pointers.

The dashboard provides the ui control node. This is a node that can be used to change which tab is being shown by the dashboard (amongst other things).

From the help for the node:

The default function is to change the currently displayed tab. msg.payload should either be an object of the form {"tab":"my_tab_name"} , or just be the tab name or numeric index (from 0) of the tab or link to be displayed.

So, with that information, you could create a flow that is:

[ui button] -> [Change] -> [ui control]

The Button node triggers the Change node which sets msg.payload to the appropriate value to pass to the control node to change the tab.

Does that make sense?

It does... I'll see if I can get it working using your example. Much thanks

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