Business Intelligence Tools / Developers Corner

Setting up a Button Function

What I’m calling the ‘Button Function’ is a simple JavaScript that can be used to make a div class area “clickable” like a button. For the non-CSS savvy (like myself), it’s nice to have an example with the code snippet so if you need more explanation, be sure you understand this previous post and the post before that.

Here, I’ve added a JS to my HTML Editor and named it buttonFunction.


Next, I added a script parameter for buttonID using a String type and the Spotfire Control id for the action as the value. Then, I repeat these steps to make a JavaScript for each “button”.



In the my HTML Editor, I also see the same value as an ID attribute value preceded by “btn” for the DIV class. The Spotfire Control Id is in a separate Div Class towards the bottom of the script and is hidden from the display.



The result (from simple JS, CSS, and HTML) is a text area designed to look like a custom menu with clickable “buttons” that perform the action stored in the out-of-the-box Spotfire Control:


If you liked this and the previous posts, please let us know in the comments! We’d be happy to hear about your use-cases and any special design improvements that you’ve made!

Leave a Reply

Your email address will not be published. Required fields are marked *