All Apps and Add-ons

Is there a way to control layoutPanel in Tabs/Switcher ?

lionel319
Explorer

I was wondering, is there a way to control the layoutPanel for Tabs/Switcher?
I couldn't seem to make the layout contain within the Switcher itself.

1 Solution

sideview
SplunkTrust
SplunkTrust

You can have layoutPanel attributes on Switcher and on its downstream modules. The one big catch is that with the dashboard panel the roughly 20 pixel-high minimized form of any given panel will always remain visible. So if for example you had one Tab where you wanted two panels in a row, and another Tab where you wanted another chart to take up the full width of that row, it wouldn't work out right. The second panel would remain there although it would be empty.

And possible I'm not understanding what you mean by "make the layout contain within the Switcher itself". Can you elaborate?

View solution in original post

sideview
SplunkTrust
SplunkTrust

You can have layoutPanel attributes on Switcher and on its downstream modules. The one big catch is that with the dashboard panel the roughly 20 pixel-high minimized form of any given panel will always remain visible. So if for example you had one Tab where you wanted two panels in a row, and another Tab where you wanted another chart to take up the full width of that row, it wouldn't work out right. The second panel would remain there although it would be empty.

And possible I'm not understanding what you mean by "make the layout contain within the Switcher itself". Can you elaborate?

sideview
SplunkTrust
SplunkTrust

oh. Well you'd have to write a customBehavior, drive it from a CustomBehavior module downstream from the Switcher, implement onContextChange, put no group attribute on it at all. Then in that custom code (running onContextChange), you'd get var currentTab=this.getContext().get("yourSwitcherModulesName");, and then based on that you'd either
a) do some brute force hiding/showing/resizing
b) do something a little more elegant iterating over all panels, hiding the ones that contain no visible modules, and resizing the panel widths.

0 Karma

lionel319
Explorer

yah. My question is actually ....

How do we achieve this in code ==> "one set of active panels populating 2 columns in 3 rows, and another set of active panels populating 3 columns in 2 rows"
:)

0 Karma

sideview
SplunkTrust
SplunkTrust

The Tabs and Switcher modules have no control over the layoutPanels themselves, in fact they do not know about layoutPanels at all. The switchery will simply conrol which modules should be visible and which should not. But it's the page template itself at page-load time that determines the structure of the page. So like I was trying to explain in my "one big catch", if you have one set of active panels populating 2 columns in 3 rows, and another set of active panels populating 3 columns in 2 rows, what you'll get is 3 rows with 3 columns, with some blank spots depending on active tab.

0 Karma

lionel319
Explorer

Sorry for not being clear. Let me try again.

Say, I have 2 tabs, TAB1 and TAB2.
I'd like TAB1 to have 2row 3col,
and TAB2 to have 3row 2col.

So, this was what I did:-
the element in TAB1's row1 col1 will use layoutPanel="panel_row1_col1"
The element in TAB2's row1 col1 will use layoutPanel="panel_row1_col1"

This doesn't seem to work.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...