Jump to content
  • 0

Expand both options


Leon13

Question

Greetings, excuse the poor title, but I do not know how better to describe what I am trying to accomplish; however the screenshots below should explain it.

I would like my users to only click on "one" "+", then the other should expand automatically.

As you can see, the user clicks only once on the "+" identified by the arrow and I hope to expand the option with the read circle automatically.

Thank you for sharing any creative ideas!

:)

image.thumb.png.9273e8fae4c9e3e32310d2e16f15a32e.png

image.thumb.png.c691d7f5b4cce3a7c8118c284cc14ace.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

@Leon13

I think that the best approach is to let your users to either expand all the groups or use the default option.
To make it works, you need to add this code to the Footer of the Result set:

<script type="text/javascript">
function customClick() {
 var elems = document.getElementsByClassName('cbResultSetShowHideGroupText');
 for(let i = 0; i < elems.length; i++) {  
  if(elems[i].children[0].alt === "expand icon") {
   elems[i].click();
  }
 }
}

function assignEvent() {
 document.getElementById('expandAll').addEventListener('click', customClick);
 document.removeEventListener('DataPageReady', assignEvent);
}

document.addEventListener('DataPageReady', assignEvent);
</script>

And this code to the Header of the result set:

<button id="expandAll">Expand All</button>

Please note that you need to disable the HTML editor of the Header/Footer. You can make this in the Advanced section.

Link to comment
Share on other sites

  • 0
3 hours ago, Hastur said:

@Leon13

I think that the best approach is to let your users to either expand all the groups or use the default option.
To make it works, you need to add this code to the Footer of the Result set:


<script type="text/javascript">
function customClick() {
 var elems = document.getElementsByClassName('cbResultSetShowHideGroupText');
 for(let i = 0; i < elems.length; i++) {  
  if(elems[i].children[0].alt === "expand icon") {
   elems[i].click();
  }
 }
}

function assignEvent() {
 document.getElementById('expandAll').addEventListener('click', customClick);
 document.removeEventListener('DataPageReady', assignEvent);
}

document.addEventListener('DataPageReady', assignEvent);
</script>

And this code to the Header of the result set:


<button id="expandAll">Expand All</button>

Please note that you need to disable the HTML editor of the Header/Footer. You can make this in the Advanced section.

@Hastur - Greatly appreciate your input and the time you took to research this.

I think I am getting the expand options fine with the settings below from the Tabular report.
Your information will definitely help me in the future.
For now, I might just let the user manually collapse the matching options, my concern is just that if the user accidentally do not match the options correctly then it leaves room for human error.

Big Thanks!!!  :)



image.png.3420c1fb0eceec987e34fb7f2dd3a0ce.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...