是否有可能只有 shinyTree 中最低级别的孩子有一个复选框?在下面的屏幕截图中,我希望“Recreational -Fishing”和“Boat”没有复选框,但所有其他孩子都有一个复选框(在屏幕截图中;圆圈 = checkboz,+ = 没有复选框)?
谢谢!
library(shiny)
library(shinyTree)
# Create tree data ----
tree.data <- list(
'Recreational - Fishing' = structure(list(
'Boat' = structure(list(
'Cray pot'= structure("",sttype="default",sticon="glyphicon glyphicon-record"),
'Hand/rod & line' = structure("",sttype="default",sticon="glyphicon glyphicon-record"),
'Cray loop' = structure("",sttype="default",sticon="glyphicon glyphicon-record"),
'Drop net' = structure("",sttype="default",sticon="glyphicon glyphicon-record"),
'Spear' = structure("",sttype="default",sticon="glyphicon glyphicon-record"),
'Other' = structure("",sttype="default",sticon="glyphicon glyphicon-record")),
sttype="default",stopened=FALSE,sticon="glyphicon glyphicon-plus", stdisabled=TRUE)),
sttype="default",stopened=FALSE,sticon="glyphicon glyphicon-plus")
)
# UI ----
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
shinyTree("tree", checkbox = TRUE, search=TRUE, searchtime = 1000)
),
# Show a plot of the generated distribution
mainPanel(
)
)
)
#Server ----
server <- function(input, output) {
# Render Tree
output$tree <- renderTree({
tree.data
})
}
# Run the application
shinyApp(ui = ui, server = server)