Open the rows selected in a separate tab

Below application will give you the secondary DT table when the particular row is selected on Main DT table. Can we alter this functionality. Like instead of this, can we have reactive tabs below the main DT table. So when particualar row is selected on main DT table (say Mazda RX4), tab naming "Mazda RX4" should open having details of it. When another row is selected(say valiant), another tab should open with this name and its contents. Can we achieve this

---
title: "MRE"
author: ""
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: scroll
runtime: shiny
---

Page {data-orientation=columns}
=======================================================================

Column {data-width=650}
-----------------------------------------------------------------------

### .

```{r}
  require(DT)
  library(dplyr)
  library(tibble)

  sliderInput("filter", label = "Filter by cyl", min = 4, max = 8, step = 2, value = 6)


  filteredTable_data <- reactive({
    mtcars %>% rownames_to_column() %>%  ##dplyr's awkward way to preserve rownames
          filter(., cyl == input$filter) %>% column_to_rownames()
  })

  ##explicit assignment to output ID
  DT::dataTableOutput("filteredTable")
  output$filteredTable <- DT::renderDataTable({
    datatable(
      filteredTable_data(),
      selection = list(mode = "multiple"),
      caption = "Filtered Table (based on cyl)"
    )
  })

  filteredTable_selected <- reactive({
    ids <- input$filteredTable_rows_selected
    filteredTable_data()[sort(ids),]  ##sort index to ensure orig df sorting
  })

  ##anonymous
  DT::renderDataTable({
    datatable(
      filteredTable_selected(),
      selection = list(mode = "none"),
      caption = "Table that gets data from unfiltered original data"
    )
  })

```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.