简体   繁体   中英

Can you use uiOutput in a shiny Dashboard?

I am trying to build a shiny Dashboard and I would like to use uiOutput.

In my ui.R file in the dashboardSidebar I have a menuitem that calls uiOutput:

library(shiny)
  dashboardSidebar(
    sidebarMenu(
      menuItem("TCA", tabName = "dashboard", icon = icon("dashboard")),
      menuItem(uiOUtput("Symbols")) ....

my server.r file looks like:

 output$Symbols<-renderUI({
    selectInput('Test', 'Test:', choices = c(1,2,3), selected = 1)
  })

When I run the app:

## app.R ##
library(shinydashboard)
library(shiny)
shinyApp(ui, server)

I get an error:

Error in tag("span", list(...)) : could not find function "uiOUtput"

Do you know how to use shinyDashboard with uiOutput?

Once you correct the typo the following works for me. You should be able to use uiOuput .

library(shinydashboard)
runApp(
    list(ui = dashboardPage(
        dashboardHeader(),
        dashboardSidebar(
            sidebarMenu(
                menuItem(uiOutput("Symbols"))
            )
        ),
        dashboardBody()
    )

    , server = function(input, output) {   

        output$Symbols<-renderUI({
            selectInput('Test', 'Test:', choices = c(1,2,3), selected = 1)
        })
    }
    )
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM