Shinydashboard:如何将菜单子项放置在超链接之外

时间:2018-10-26 18:07:40

标签: hyperlink shinydashboard

我正在使用Shinydashboard,并且在dashboardSidebar中,我需要在menusubitem中选择一些元素。当我使用控件或Shift按钮在selectInput中选择多个元素时,将打开一个新的Chrome页面。当我直接在Rstudio中尝试时,没有问题。

看起来仪表板将菜单子项放置在超链接内(由Dean Attali建议)。

如何避免这种反应?

谢谢

    shinyApp(
    ui = dashboardPage(skin = 'blue',
        dashboardHeader(title = 'reprexes', titleWidth = 450),
        dashboardSidebar(width = 350,

            tags$style('.fa-table {color:#33cc33}'),     
            tags$style('.table2 {color:#0099ff}'),     

            sidebarMenu(width = 350,
            menuSubItem( p(''),
            icon = NULL),
            menuItem('Example1', icon = icon('table'),
            menuSubItem(uiOutput('col_sel'),icon = NULL)

            )
            ) # sidebarMenu
        ), # dashboardSidebar


        dashboardBody(    
            tabBox(width = '500px',

            tabPanel('Instructions', 
            h4('Plots') )   # tabPanel
            )   # tabBox
        )
    ),
    server = function(input, output, session) {
        output$col_sel <- renderUI({
        cn <-c('New York', 'Paris', 'Pekin')
        selectInput('var_1', 'Select the variables', 
        choices  = cn,
        selected = 1,
        multiple=TRUE, selectize=FALSE)
        })
    }
)

0 个答案:

没有答案