Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

325
Views
Javascript: function to display a tab based on data from a text container

I am trying to display two tabs in microstrategy web, based on a predefined string inside a text container.

For example, I want to display one tab for a user that fits into the "Trader" category only. If the text in a container that I made in the tab page has the text "Trader" as a string, then the tab display will change to block to show that page to Traders, else it will change it to none and will change the display style to block on the page for the other type of clients instead.

Right now I am stuck at trying to make it work when the user changes tabs, since at first load, one of the tabs is hidden and one is shown depending on the text container,as intended, but when I switch to other tabs/pages on the dashboard then both are being shown.

What do you suggest to make it work even when I switch between pages/tabs?

This is what I have so far.

Thank you guys!

<script type="text/javascript">

(function verify_branch(){
    if(document.getElementsByClassName('vi-doc-tf-value-text')[0].innerHTML == "Trader")
    {
        document.getElementById("mstr2056").style.display = "block";
        document.getElementById("mstr2058").style.display = "none";
        console.log("Trader");
       
    }else{
        document.getElementById("mstr2056").style.display = "none";
        document.getElementById("mstr2058").style.display = "block";
        console.log("Other");
    }
})();

</script>


about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you can use a global variable like displayDefault and check that as well

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!