title: Shiny checkbox input tracking
body: <p>I am currently working on an application form using Shiny. My main page will consist of a table that will have a click button which will open a new modal window that will display the application form details. Once the save button is clicked the data will get stored in my DB in the backend. I have given a sample example of my app using mtcars.</p>
  
  <p>My question is a two parter.</p>
  
  <ol>
  <li><p>I have added checkbox to the main page rows and wish to track the click of these check boxes so that I can check the required ones and using their click event save some other value in the DB. How can I track this checkbox click event?</p></li>
  <li><p>I need a single checkbox click to select about 150 or more check boxes simultaneously. Is there a way to capture all these click events together in an array or something and make use of them later?  </p></li>
  </ol>
  
  <p>Here is my code:  </p>
  
  <pre><code>rm(list = ls())
  library(DT)
  library(shiny)
  library(shinyBS)
  library(shinyjs)
  library(shinydashboard)
  
  shinyInput &lt;- function(FUN, len, id, ...) {inputs &lt;- character(len)
  for (i in seq_len(len)) {
    inputs[i] &lt;- as.character(FUN(paste0(id, i), ...))}
  inputs
  }
  
  ui &lt;- dashboardPage(
    dashboardHeader(title = "Simple App"),
    dashboardSidebar(
      sidebarMenu(id = "tabs",
                  menuItem("Menu Item 1", tabName = "one", icon = icon("dashboard"))
      )
    ),
    dashboardBody(
      tabItems(
        tabItem(tabName = "one",h2("Datatable Modal Popup"),
                DT::dataTableOutput('my_table'),uiOutput("popup")
        )
      )
    )
  )
  
  server &lt;- function(input, output, session) {
    my_data &lt;- reactive({
      testdata &lt;- mtcars
      as.data.frame(cbind(View = shinyInput(actionButton, nrow(testdata),'button_', label = "View", onclick = 'Shiny.onInputChange(\"select_button\",  this.id)' ),
                          Check = shinyInput(checkboxInput,label = "Check", nrow(testdata),  'box_', value = FALSE),testdata))
    })  
    output$my_table &lt;- DT::renderDataTable(my_data(),selection = 'single',options = list(searching = FALSE,pageLength = 10),server = FALSE, escape = FALSE,rownames= FALSE)
  
    SelectedRow &lt;- eventReactive(input$select_button,{
      as.numeric(strsplit(input$select_button, "_")[[1]][2])
    })
  
    observeEvent(input$select_button, {
      toggleModal(session, "modalExample", "open")
    })
  
    DataRow &lt;- eventReactive(input$select_button,{
      my_data()[SelectedRow(),2:ncol(my_data())]
    })
  
    output$popup &lt;- renderUI({
      bsModal("modalExample", paste0("Data for Row Number: ",SelectedRow()), "", size = "large",
              column(12,                   
                     DT::renderDataTable(DataRow())
  
              )
      )
    })
  
  }
  
  shinyApp(ui, server)
  </code></pre>