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)
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