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

174
Views
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
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!