1 Reply Latest reply on Nov 19, 2015 11:53 AM by Gary Gambill

    How to show or hide sheets/Dashboard using java Script.

    SHCTableau SGS

      Hi All,


      1. We have a workbook with 3 sheets (Employee Grid, Employee Graph and Employee Pic) and two dashboards (Employee Dashboard and Employee Dashboard1).
      2. We have deployed all 3 sheets and 2 dashboards to the Tableau Server.
      3. We have integrated this dashboard with our portal using .net.
      4. We wants to show only Employee Dashboard or Employee Dashboard and Employee Dashboard 1 (both), using java Script from web portal.
      5. Please suggest us to implement this.
        • 1. Re: How to show or hide sheets/Dashboard using java Script.
          Gary Gambill

          This should be able to be done with the JavaScript API when you initialize the visualization.


          Have some sort of way of identifying the type of user that is hitting the page and based on that, set the hideTabs option whichever way you want.  Make sure the Employee page is the first worksheet/dashboard loaded via the URL parameter.


          Basic Example:


          var hideTabsCheck = false;

          if (userType == 'employee')

               hideTabsCheck = true;


          var placeholderDiv = document.getElementById("tableauViz");

          var url = yourURL;


          var options = {

               width: window.innerWidth * 0.985,

               height: window.innerHeight * 0.875,

               hideTabs: hideTabsCheck,

               hideToolbar: true,

               onFirstInteractive: function () {





          viz = new tableauSoftware.Viz(placeholderDiv, url, options);