Dashboards & Visualizations

Is there a tagname I can use in simple XML that I can put multiple rows in that I can then toggle hide/show?

HattrickNZ
Motivator

Is there a tagname I can use in simple XML that I can put multiple rows in that I can then toggle hide/show?

for instance the below skeleton would show:

row
row
row

Can I have something like, below, where I can sho/hide the 2nd and 3rd row together?:

row
<tagname depends="$mytoken$">
row
row
</tagname>

skeleton dashboard below:

<form>
       <label>dashboard name</label>

     <fieldset autoRun="true" submitButton="false">
     <input type="checkbox" token="sourcetype_token" searchWhenChanged="true">
         <choice value="show">show</choice>
         <choice value="hide">hide</choice>
     </fieldset>

     <row>
         <panel>
             <chart>

             ...

             </chart>
         </panel>
     </row>
     <row>
         <panel>
             <chart>

             ...

             </chart>
         </panel>
     </row>
     <row>
         <panel>
             <chart>

             ...

             </chart>
         </panel>
     </row>
 </form>

woodcock
Esteemed Legend

I do not think you can do exactly what you describe but what is wrong with doing a look-alike thing that is absolutely indistinguishable by users like this?

<form>
   <label>dashboard name</label>

  <fieldset autoRun="true" submitButton="false">
  <input type="checkbox" token="show_token" searchWhenChanged="true">
      <choice value="show">show rows 2 and 3</choice>
  </fieldset>

  <row>
      <panel>
          <chart>

          ...

          </chart>
      </panel>
  </row>
  <row depends=$show_token$>
      <panel>
          <chart>

          ...

          </chart>
      </panel>
  </row>
  <row depends=$show_token$>
      <panel>
          <chart>

          ...

          </chart>
      </panel>
  </row>
</form>
0 Karma

woodcock
Esteemed Legend

The fieldset's autoRun="true" setting causes the dashboard run with all fields' defaults settings when the dashboard is first visited and the input's searchWhenChanged="true" setting causes the dashbaord to re-run whenever the checkbox is un/ticked. Seriously; just try it.

0 Karma

jeffland
Champion

I don't think you can wrap your rows in something, they're supposed to be the first element in a dashboard/form. But I don't see why you shouldn't be able to make all rows depend on the same token, so they will all display or hide at the same time with a single setting, somewhat like this:

...
</fieldset>
  <row depends="token">
    <panel>
      <chart>
        ...
      </chart>
    </panel>
  </row>
  <row depends="token">
    <panel>
      <chart>
            ...

See the Simple XML reference and look for "depends", you can use it to show or hide almost any element in a dashboard depending on one or more tokens.

0 Karma

HattrickNZ
Motivator

tks, i will do that then, I was just looking for another way of doing the same thing, although slightly differenty.

0 Karma

HattrickNZ
Motivator

when does the code in side depends="token" run?

Does it run when the dashboard is first visited?

Or is it when the checkbox is first ticked?

0 Karma

jeffland
Champion

The "depends" attribute will be in effect for as long as you are on that page, i.e. the panel will show and hide dynamically based on the token indefinitely. Therefore I don't really know how to answer the question about "when it is run", sorry.

0 Karma

jeffland
Champion

Markup messed up your code, you'll have to leave a line blank and indent by four spaces when you want to use angled brackets:

<works>
0 Karma

HattrickNZ
Motivator

have edited my question/comment, hope it makes sense. Could you advise? tks

0 Karma

woodcock
Esteemed Legend
0 Karma

HattrickNZ
Motivator

no, ithink it is slightly different, that Q just works on a panel/row, i want to work on multiple panels/rows at the same time

0 Karma

woodcock
Esteemed Legend

In any case, the answer is exactly the same: depends.

0 Karma

woodcock
Esteemed Legend

As far as setting a default, just before the end of the input you use the "name" of the setting like this:

<input>
   ....
   ...
  <default>Hide</default>
</input>
0 Karma