
To hide/show and recalculate widths of panels in multi-panel rows, you would have to write a little customBehavior in JS. However this only solves problem #1 above, which makes it only useful for hiding/showing full-width panels. You would often use this module in pairs, where a push at one spot hides N panels, and a push at another spot shows them. Sideview Utils does have a prototype module I added in 3.1 called ShowHide that you can use to explicitly show and hide any CSS selector(s) when that module receives pushes. Since the module system doesn't even know anything at the page template level, it can't see these fixed widths to adjust them later at runtime. As a result,ġ) the outer rounded-corner bits of the panels remain visible even when all their modules have hidden themselves.Ģ) the panel widths are set when the page loads, such that in a three column row, each one has width:33% in it in the template. problem really, is that the dashboard.html template was never designed to accommodate things on the page that might show and hide some of the panels. =/ (Yes autoRun is very strange but if you follow the rule of only ever having one, and always having it at the top, almost all of the strangeness goes away)ģ) and thirdly, here's a slightly cleaner version of your JS function that you may find useful. With the autoRun="true" on the Search module, the very first push on page load doesn't hide the checkbox because nobody has pushed the TimeRangePicker's data downstream yet. IN this case you should move it up to the TimeRangePicker and not have any autoRun on the Search module. It actually tells any module "when the page loads, start pushing data to all downstream from this point", and as such it should always be up at the top of the hierarchy. You have an autoRun="True" but you've made a common mistake which is to put it on the Search module thinking it tells the Search module to run it's search. For the second you meant to check the getLatestTimeTerms not getEarliestTimeTerms.Ĭhanging that alone gets it to mostly work.Ģ) There is also a second lesser problem though. Now the checkbox goes away as soon as I change the time range and never comes back regardless of the setting.ġ) The main problem is that your if statement is only firing if the earliest time term is and also the earliest time term is "now". If & this.getContext().get("search").getTimeRange().getEarliestTimeTerms()="now")Īnd yes, I rebooted splunkweb to make sure application.js has been read by splunk after my change.ĮDIT: I just found 2 errors, thanks to google developper tools.ġ- there was a brace missing in my javascript.Ģ- I needed to get the context from "this". Var methodReference = (checkBoxModule) ĬheckBoxModule.onContextChange = function() ("LRO_ShowAutoRefreshCheckBox", function(checkBoxModule)
#SPLUNK SHOWHIDE PANEL SIDEVIEW CODE#
But it's all there.Īnd here is the code I added in application.js:


OK the code looks partly marked as code partly as regular comments.
Index=os * | rex 'lvn-(?įor 5 mins auto-refresh select the "Last 60 minutes" time range. It should only be visible when the user selects "Last 60 minutes" in the TimeRangePicker.

The checkbox remains visible regardless of the time range I select.

I wrote the code below after looking at many examples, and reviewing the modules documentation.Īnd yet, I can't get it to work.
