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>
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>
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.
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.
tks, i will do that then, I was just looking for another way of doing the same thing, although slightly differenty.
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?
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.
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>
have edited my question/comment, hope it makes sense. Could you advise? tks
Is not this a duplicate of this question?
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
In any case, the answer is exactly the same: depends
.
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>