-2
Problem ist, möchte ich sidebar menuItem mit einer Liste füllen. Allerdings habe ich auf dem Click klicken CWE Titel zu laden“menuItem, klicken Sie dann andere menuItem für sie zu füllenR - wie man glänzenden Armaturenbrett sidebar menuItem
Ich möchte die Liste verstecken können.
library(shinydashboard)
cwetitles <- c("criosphinx","bibliophilic","billing","rudolf",
"overromanticizing","nonunderstandable","carboniferous","wan",
"calcanei","inimically","unenlivening","scissure","flamboyantly",
"hypotonicity","impressionableness","coligny","attender",
"perspective","enumclaw","diddicoy")
ui <- dashboardPage(
dashboardHeader(title ="CVE Reporting Dashboard", titleWidth = 350),
dashboardSidebar(
sidebarMenu(id = "tabs",
menuItem("Overview", tabName="summary", icon=icon("info-circle")),
menuItem("Dashboard", tabName = "dashboard", icon=icon("dashboard")),
menuItem("Charts", tabName = "charts", icon = icon("bar-chart-o")),
menuItem("Click to View CVE Category", icon = icon("info-circle"),
menuSubItem("General CVEs",icon=icon("th"),tabName ="cvetable"),
menuSubItem("Web Applications CVEs",icon=icon("th"),tabName ="WASC")
),
actionButton(inputId="clearAll", label="Clear selection", icon=icon("square-o"),style="color:#fff; background-color:#337ab7; border-color: #2e6da4"),
actionButton(inputId="selectAll", label="Select all", icon=icon("check-square-o"),style="color:#fff; background-color: #337ab7; border-color: #2e6da4"),
menuItem("Click to Load CWE Titles",tabName = "cwetitlesControl", icon = icon("th"), uiOutput("cwetitlesControl"), selected = TRUE)
)
),
dashboardBody(
tabItems(
tabItem(tabName = "summary",includeMarkdown("about.md"))
)
)
)
server <- function(input, output) {
# use a reactive value to represent group level selection
values <- reactiveValues()
values$cwetitles <- cwetitles
# Create event type checkbox
output$cwetitlesControl <- renderUI({
withProgress(message = 'Calculation in progress',
detail = 'This may take a while...', value = 0, {
for (i in 1:15) {
incProgress(1/15)
Sys.sleep(0.25)
}
})
checkboxGroupInput('cwetitles', 'CWE Titles:',choices = cwetitles, selected = values$cwetitles)
})
}
shinyApp(ui, server)
es sieht aus wie Sie haben, dass 'cwetitles' Eingang (a' checkboxGroupInput') in der Server-Funktion. das sollte wahrscheinlich in deinem Ui sein, vielleicht ist das das Problem? – rosscova
spielt keine Rolle, wo es ist lo cated. Ich will es im Server.R weil ich reaktive Eingänge habe. Wenn ich uiOutput() nicht in menuItem ablege, wird es sofort ausgefüllt. Allerdings möchte ich in der Lage sein, es zu verstecken –
Sie können reaktive Eingaben mit 'updateCheckboxGroupInput' in Ihrem Server haben, sobald Sie' checkboxGroupInput' in Ihrem ui definiert haben. Dann können Sie es mit einem 'conditionalPanel' anzeigen oder ausblenden oder mit' shinyjs' anzeigen/ausblenden. Würde das erreichen, was Sie erhoffen? – rosscova