All Apps and Add-ons

Sideview Checkbox Layout

cramasta
Builder

Hi,
Is it possible to have the dynamic checkbox layout be horizontal rather than vertical? I have about 30 checkboxes having them be vertical takes up a lot of space on the dashboard.

Thanks

1 Solution

sideview
SplunkTrust
SplunkTrust

<param name="float">left</param>

However this will only take effect a half second or so after the page loads, meaning there will be a noticeable jitter as the Checkboxes lay out vertically and then switch to horizontally. So while the float param is useful in a pinch, the best practice is to use a little custom CSS. If your view name is your_view_name_here, it would look like:

.splView-your_view_name_here .Checkbox {
  float:left;
}

UPDATE:

With the Checkboxes module instead of the simpler Checkbox module, there is no equivalent param, and as for custom CSS, you would use this slightly different CSS.

.splView-your_view_name_here .Checkboxes .checkboxWrapper {
  float:left;
}

Depending on what content is underneath your Checkboxes, you might find the layout underneath gets a little weird.

Also before you get too deep into custom CSS, you should note that all Sideview modules have a param called cssClass that allows you to put a special CSS class on their container div, and that this can be useful for cleanly specifying CSS behavior for only certain modules in a view. read the Checkboxes/Checkbox documentation and when you're done, click the link that says "view the specification for the [module] module" and you'll see the raw param specification including the cssClass param.

View solution in original post

sideview
SplunkTrust
SplunkTrust

<param name="float">left</param>

However this will only take effect a half second or so after the page loads, meaning there will be a noticeable jitter as the Checkboxes lay out vertically and then switch to horizontally. So while the float param is useful in a pinch, the best practice is to use a little custom CSS. If your view name is your_view_name_here, it would look like:

.splView-your_view_name_here .Checkbox {
  float:left;
}

UPDATE:

With the Checkboxes module instead of the simpler Checkbox module, there is no equivalent param, and as for custom CSS, you would use this slightly different CSS.

.splView-your_view_name_here .Checkboxes .checkboxWrapper {
  float:left;
}

Depending on what content is underneath your Checkboxes, you might find the layout underneath gets a little weird.

Also before you get too deep into custom CSS, you should note that all Sideview modules have a param called cssClass that allows you to put a special CSS class on their container div, and that this can be useful for cleanly specifying CSS behavior for only certain modules in a view. read the Checkboxes/Checkbox documentation and when you're done, click the link that says "view the specification for the [module] module" and you'll see the raw param specification including the cssClass param.

gregstengel
New Member

I am trying to do this same thing, but I am unclear where you put this custom CSS?

0 Karma

cramasta
Builder

Thanks for the update. I forgot that there were two modules for checkboxes.

This worked perfectly for me. First time I had to include custom CSS in my views

0 Karma

sideview
SplunkTrust
SplunkTrust

Oh Sorry. I thought you were using individual Checkbox modules, but I wasn't thinking. Yes it's different with Checkboxes module. I'll update my answer.

0 Karma

cramasta
Builder

left doesnt seem to work with Checkboxes

0 Karma

cramasta
Builder

Would this need to be changed if using Checkboxes

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...