Dashboards & Visualizations

How to set width of input multiselect?

GaryZ
Path Finder

I'm looking to change the width of the multiselect input box.  It's currently dynamically updated, and the lengths of the input varies.  

 

Would it be possible to change the width dynamically (if not static)?  

 

TIA.

GaryZ_0-1683221592148.png

 

Labels (5)
0 Karma

tscroggins
Influencer

Hi,

You'll need to manipulate the style of the fieldset and input div tags. This example is just a starting point. It impacts the display of the dashboard when editing and may break accessibility:

<form version="1.1" theme="dark">
  <label>Multiselect Width</label>
  <fieldset submitButton="false">
    <html>
      <style>
        .fieldset {
          display: table;
        }
        #fixed_width_multiselect {
          display: table-cell !important;
          width: 500px !important;
        }
        #fixed_width_multiselect div[role="listbox"] {
          display: table-cell !important;
          width: 480px !important;
        }
        #dynamic_multiselect {
          display: table-cell !important;
          white-space: nowrap !important;
        }
        #dynamic_multiselect div[role="listbox"] {
          display: table-cell !important;
        }
      </style>
    </html>
    <input id="fixed_width_multiselect" type="multiselect" token="fixed_width_multiselect_tok">
      <label>Fixed-Width Multiselect</label>
      <!-- ... -->
    </input>
    <input id="dynamic_multiselect" type="multiselect" token="dynamic_multiselect_tok">
      <label>Dynamic Multiselect</label>
      <!-- ... -->
    </input>    
  </fieldset>
</form>

Note that your Splunk administrator may disable the <html> tag in dashboards, in which case you'll need their assistance adding a CSS file to the app and referencing it with the stylesheet attribute of the <form> tag.

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...