如何从我的 Shiny 应用程序中的可反应表中删除单选按钮列,但保留
selection = "single"
参数?
我的代表是基于这个solution用
selection = "multiple"
隐藏全/无复选框,我希望我可以做类似的事情来删除单选按钮。
app.R
:
library(shiny)
library(reactable)
ui <- fluidPage(
includeCSS("hide_radio.css"),
titlePanel("Hide radio buttons"),
mainPanel(reactableOutput("table"))
)
server <- function(input, output) {
output$table <- renderReactable({
reactable(
mtcars,
selection = "single",
columns = list(
.selection = colDef(
headerStyle = list(pointerEvents = "none")
)
),
theme = reactableTheme(
headerStyle = list("& input[type='checkbox']" = list(display = "none"))
)
)
})
}
shinyApp(ui = ui, server = server)
hide_radio.css
:
.hide-checkbox {
pointer-events: none;
}
.hide-checkbox input[type='checkbox'] {
display: none;
}