I am trying to make a Shiny app using golem, but I am very new to this. This time I just want to make a small table with checkboxes and a scroll bar, but I am not succeeding...
This is the only thing I manage to make work so far (but even the scrollbar does not seem to show):
mod_saving_side_ui <- function(id){
ns <- NS(id)
tagList(
shinyjs::useShinyjs(),
shinyalert::useShinyalert(),
fluidRow(
DT::DTOutput(ns("my_marker_table"), width = "75%")
)
)
}
mod_saving_side_server <- function(id, r){
moduleServer( id, function(input, output, session){
ns <- session$ns
output$my_marker_table <- DT::renderDT({
marker_df <- data.frame(marker=LETTERS, positive="", negative="")
marker_df$positive[1] <- "y"
marker_df$negative[2:4] <- "y"
marker_matrix <- as.matrix(marker_df)
DT::datatable(marker_matrix, options = list(scrollY = TRUE, sDom = '<"top">rt<"bottom">ip'), rownames = FALSE)
})
})
}
It produces this:
However I would like to accomplish 3 things:
- Have a scrollbar instead of the
Previous
1
2
3
Next
buttons - Make the
positive
andnegative
columns have a checkbox per row - Have the
positive
checkbox preselected for the first rowA
, and thenegative
checkbox preselected for the 2:4 rowsB
,C
,D
How to make checkboxGroupInput
work in here and the scrollbar to show? Thanks!
Aucun commentaire:
Enregistrer un commentaire