Dashboards & Visualizations

DASHBOARD Checkbox with ALL option-- All panels should be visible

sagar1992
Explorer

Hi Team,

I was able to link each checkbox to each panel with below approach:

`

Reports
showPanel2
showPanel2

`

Now I would like to have ALL as an option.

How can I link one checkbox with all panels?

I don't want to use Javascript/CSS. just basic configuration should do.

I also tried below but it is not working. copying token to all panels.

<panel id="panel2" depends=**"$showPanel2$,$ALL$"**>

screenshot below:
alt text

0 Karma
1 Solution

niketn
Legend

@sagar1992 try the following run anywhere example and confirm whether it suits the needs.

<form>
  <label>CheckBox All</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel>
      <input type="checkbox" token="tokAllReports">
        <label>All</label>
        <choice value="all_reports">Reports</choice>
        <change>
          <condition value="all_reports">
            <!-- Set all other checkboxes to show all reports -->
            <set token="form.tokMonthlyReports">monthly_reports</set>
            <set token="form.tokDailyReports">daily_reports</set>
          </condition>
          <condition>
            <!-- Unset all other checkboxes to hide all reports -->
            <unset token="form.tokMonthlyReports"></unset>
            <unset token="form.tokDailyReports"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokMonthlyReports">
        <label></label>
        <choice value="monthly_reports">Monthly Reports</choice>
        <change>
          <condition value="monthly_reports">
            <!-- Show monthly report -->
            <set token="tokShowPanelMonthly">true</set>
          </condition>
          <condition>
            <!-- Hide monthly report -->
            <unset token="tokShowPanelMonthly"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokDailyReports">
        <label></label>
        <choice value="daily_reports">Daily Reports</choice>
        <change>
          <condition value="daily_reports">
            <!-- Show daily report -->
            <set token="tokShowPanelDaily">true</set>
          </condition>
          <condition>
            <!-- Hide daily report -->
            <unset token="tokShowPanelDaily"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
  <row>
    <panel id="panelMonthly" depends="$tokShowPanelMonthly$">
      <html>
        <div>
          <h3>Monhtly Report Panel</h3>
        </div>
      </html>
    </panel>
    <panel id="panelDaily" depends="$tokShowPanelDaily$">
      <html>
        <div>
          <h3>Daily Report Panel</h3>
        </div>
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@sagar1992 try the following run anywhere example and confirm whether it suits the needs.

<form>
  <label>CheckBox All</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel>
      <input type="checkbox" token="tokAllReports">
        <label>All</label>
        <choice value="all_reports">Reports</choice>
        <change>
          <condition value="all_reports">
            <!-- Set all other checkboxes to show all reports -->
            <set token="form.tokMonthlyReports">monthly_reports</set>
            <set token="form.tokDailyReports">daily_reports</set>
          </condition>
          <condition>
            <!-- Unset all other checkboxes to hide all reports -->
            <unset token="form.tokMonthlyReports"></unset>
            <unset token="form.tokDailyReports"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokMonthlyReports">
        <label></label>
        <choice value="monthly_reports">Monthly Reports</choice>
        <change>
          <condition value="monthly_reports">
            <!-- Show monthly report -->
            <set token="tokShowPanelMonthly">true</set>
          </condition>
          <condition>
            <!-- Hide monthly report -->
            <unset token="tokShowPanelMonthly"></unset>
          </condition>
        </change>
      </input>
      <input type="checkbox" token="tokDailyReports">
        <label></label>
        <choice value="daily_reports">Daily Reports</choice>
        <change>
          <condition value="daily_reports">
            <!-- Show daily report -->
            <set token="tokShowPanelDaily">true</set>
          </condition>
          <condition>
            <!-- Hide daily report -->
            <unset token="tokShowPanelDaily"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
  <row>
    <panel id="panelMonthly" depends="$tokShowPanelMonthly$">
      <html>
        <div>
          <h3>Monhtly Report Panel</h3>
        </div>
      </html>
    </panel>
    <panel id="panelDaily" depends="$tokShowPanelDaily$">
      <html>
        <div>
          <h3>Daily Report Panel</h3>
        </div>
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

sagar1992
Explorer

Hello @niketnilay,
added below tags according to my needs, and it worked.

<input type="checkbox" token="tokAllReports" searchWhenChanged="true">
         <label>All</label>
         <choice value="all_reports">All Reports</choice>
         <change>
           <condition value="all_reports">
             <!-- Set all other checkboxes to show all reports -->
             <set token="form.showPanel1">monthly_reports</set>
             <set token="form.showPanel5">daily_reports</set>
             <set token="form.showPanel2">monthly_reports</set>
             <set token="form.showPanel6">daily_reports</set>
             <set token="form.showPanel3">monthly_reports</set>
             <set token="form.showPanel4">monthly_reports</set>
           </condition>
           <condition>
             <!-- Unset all other checkboxes to hide all reports -->
             <unset token="form.showPanel1"></unset>
             <unset token="form.showPanel5"></unset>
             <unset token="form.showPanel2"></unset>
             <unset token="form.showPanel6"></unset>
             <unset token="form.showPanel3"></unset>
             <unset token="form.showPanel4"></unset>
           </condition>
         </change>
       </input>

Thank you so much!! looks good. 🙂
Happy Sunday.
:)

niketn
Legend

Happy Weekend to you too!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...