0

I am trying to build dataTable in shiny which it's first column is variable names , it's second and third are checkboxes, the checkboxes which the user clicked in the second column are the variables that i want to exclude from my model. the checkboxes which the user clicked in the third column (alllowed only once) is the target variable.

I found a code in google which i used, so my code look like this:

data<-read.csv(file.choose(),header = TRUE,sep=",",quote="") #,quote=""
df.var.names <- names(data)
addCheckboxButtons <- paste0('<input type="checkbox" name="row', df.var.names, '" value="', df.var.names, '">',"")

Table<-DT::datatable(cbind(df.var.names,Exclude_variables=addCheckboxButtons,Choose_Target_variable=addCheckboxButtons),
                      options = list(orderClasses = TRUE,
                                     lengthMenu = c(5, 25, 50),
                                     pageLength = length(df.var.names), 
                                     callback = JS("function(table) {
                                                   table.on('change.dt', 'tr td input:checkbox', function() {
                                                   setTimeout(function () {
                                                   Shiny.onInputChange('rows', $(this).add('tr td input:checkbox:checked').parent().siblings(':last-child').map(function() {
                                                   return $(this).text();
                                                   }).get())
                                                   }, 10); 
                                                   });
                                    }")),escape = FALSE)

enter image description here

my question is : how can i access the checked boxes in the second and third column seperatly

source of the code : enter link description here

Community
  • 1
  • 1
Basel.D
  • 349
  • 1
  • 18
  • Possible duplicate of [adding a column with TRUE/FALSE and showing that as a checkbox](http://stackoverflow.com/questions/37356625/adding-a-column-with-true-false-and-showing-that-as-a-checkbox) – Carl Nov 16 '16 at 23:19
  • Maybe [this](http://stackoverflow.com/questions/37875078/shiny-checkbox-in-table-in-shiny) can be of some help. – SBista Nov 17 '16 at 13:22

0 Answers0