0

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)
    })
  }
))
Jian
  • 365
  • 1
  • 6
  • 19
  • Not clear what you really wanted – akrun Sep 12 '17 at 15:40
  • I modified the description. Essentially because the tabs are dynamically created. I failed to call them or call the tables in these tabs. – Jian Sep 12 '17 at 17:57
  • Is the source of your problem that the tables aren't available because they haven't been rendered yet? If that's the case, see `outputOptions` – Benjamin Sep 12 '17 at 18:34
  • I guess so, because the tables/tabs are dynamically created. Could you explain more how to utilized outputOptions. Thanks. – Jian Sep 18 '17 at 13:35

0 Answers0