R Shiny call tables in dynamic tabs

135 Views Asked by At

I have data tables in dynamic tabs, which will require the user to input data. How to call those tables and process the user data from the dynamic tabs?

library(shiny)
library(rhandsontable)

DF <- data.frame(sample=c(350292, 350293), test=c(2, 3))

runApp(list(
  ui = pageWithSidebar(
    headerPanel('Dynamic Tabs'),
    sidebarPanel(
      numericInput("nTabs", 'No. of Tabs', 5)
    ),
    mainPanel(
      uiOutput('mytabs')  
    )
  ),
  server = function(input, output, session){
    output$mytabs = renderUI({
      nTabs = input$nTabs
      myTabs = lapply(paste('Tab', 1: nTabs), tabPanel,
                  rhandsontable(DF))
      do.call(tabsetPanel, myTabs)
    })
  }
))
0

There are 0 best solutions below