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

175
Visualizações
link tabsets on clink in flexdashboard

I'm making a flexdashboard and would like parallel tabsets, so that when a tab is clicked in one row, the nth tab is also opened in the section row. I have tried to work from a very similar SO example (Change second tabset on click in flexdashboard), but when I knit, there is no effect from the javascript - the behavior is unchanged.

Here is the specific answer I am trying to implement:


    ---
    title: "Untitled"
    output: 
      flexdashboard::flex_dashboard:
        orientation: columns
        vertical_layout: fill
    ---
    
    ```{r setup, include=FALSE}
    library(flexdashboard)
    ```
    
    ```{js}
    document.addEventListener("DOMContentLoaded", function(){
        $('a[data-toggle="tab"]').on('click', function(e){
          // find the tab index that is click
          child = e.target.parentNode;
          tabnum = Array.from(child.parentNode.children).indexOf(child);
          // find in which column we are
          column = $(e.target).closest("div[id]");
          // show the same tab in the other column
          columnid = column.attr("id");
          if (columnid == "column") {
            columnto = "column-1";
          } else {
            columnto = "column";
          }
          $("div[id="+columnto+"] li:eq("+tabnum+") a").tab('show');
        })
    });
    ```
    
    Column {.tabset}
    -----------------------------------------------------------------------
    
    ### Chart A1
    
    This is a text
    
    ### Chart B1
    
    ```{r}
    plot(iris)
    ```
    
    
    Column {.tabset}
    -----------------------------------------------------------------------
    
    ### Chart A2
    
    ```{r}
    plot(mtcars)
    ```
    
       ### Chart B2
    
       This is another text
    
    ```
about 4 years ago · Juan Pablo Isaza
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