Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

327
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda