Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Show / Hide Spotfire Controls from checkbox

html:


<span id='trigger'>Show container</span> 

<div id='container' 
style="
   background:beige;
   border:1px solid darkorange;
   overflow-x:auto;
   height:150px;
   width:222px;
   box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
   position:fixed;
   z-index:1
">
   <p>spotfire controls can go here
   <p><SpotfireControl id="764a8853d46645678c90ff1ae70895ca" />
   <center><h4>hellow world</h4></center> 
</div> 

   

js:
//setup trigger
let checkbox = document.createElement("input")
checkbox.type='checkbox'

let box = document.getElementById(idContainer)
checkbox.addEventListener("click",()=>{box.hidden=!box.hidden})

let trigger = document.getElementById(idTrigger)
trigger.prepend(checkbox," ")

box.hidden=true
 






9 comments:

Julie said...

As of version 7.5, all Spotfire controls are in div containers. The onChange function does not work on the dropdown.

Unknown said...

so what do you do instead please?

Edoardo said...

Hi Jose, is it possible to insert a spotfire filter (for example checkboxes filter) inside a custom dropdown? Thank you!

Jose Leviaguirre said...

Hello Spotfirist,

Yes, you can put any control or filters inside the container as per the updated example above.

Edoardo said...

Sorry Jose I wasn't clear enough. In your example I have to use a text area as big as the size of the filter I need to show/hide.
I would like to use a smaller text so when I click on the dropdown it will extend outside the text area.
As for example, I need something like this: https://html.form.guide/checkbox/dropdown-with-checkbox-bootstrap/.
Is that possible in Spotfire?

Jose Leviaguirre said...

Spotfirist, instead of a checkbox, you can place a dropdown image and the effect will be the same as opening a dropdown. If you want the value of the dropdown to change, then you can use a calculated value and add some style to make it look like a dropdown. Great idea for an article. Check out my latest post

Edoardo said...

Thank you so much :) Your site is a treasure! Really helped me a lot.

Edoardo said...

Hi Jose, I have another question for you! Is it possible to format a listbox in a text area so it resembles more a listbox in filter panel (with checkboxes and searchbox)? If I wasn't clear, you can see in this images what I mean: https://imgur.com/a/A0atbhQ

Thank you!

Jose Leviaguirre said...

Hello spotfirist

Just right click the filter on the filter panel and choose filter scheme properties down the bottom. Make sure the column is mapped as a List Box Filter and the you have the filter settings show check boxes on.