我正在尝试使用闪亮创建仪表板。
我的想法是在身体上只创建一个仪表板屏幕。但是,我想在子菜单中分隔每个输入选择:
例如:
当我点击子菜单向下滚动(红色圆圈)时,我希望看起来是一个输入选择。
我正在使用这个脚本:
convertMenuItem <- function(mi,tabName) {
mi$children[[1]]$attribs['data-toggle']="tab"
mi$children[[1]]$attribs['data-value'] = tabName
if(length(mi$attribs$class)>0 && mi$attribs$class=="treeview"){
mi$attribs$class=NULL
}
mi
}
ui <- dashboardPage(
dashboardHeader(title = "Menu",
dropdownMenu(type = "messages",
messageItem(from = "Menu", message = "Welcome"))),
dashboardSidebar(collapsed = TRUE,
sidebarMenu( id = "tabs",
convertMenuItem(menuItem("Dashboard", tabName = "dashboard",icon = icon("dashboard"), selected=T,
menuItem("Catergoria de Conta", newTab = FALSE),
menuItem("Unidades", newTab = FALSE )),"charts"))),
如何在menuitem中创建此输入:
selectInput("continents", "Selecione as contas",choices = levels(tbl1$`Contas Resultado`), multiple = TRUE,selected = "Europe"))
答案 0 :(得分:0)
解决。
ui <- dashboardPage(
dashboardHeader(title = "Menu",
dropdownMenu(type = "messages",
messageItem(from = "Menu", message = "Welcome"))),
dashboardSidebar(collapsed = TRUE,
sidebarMenu( id = "tabs",
convertMenuItem(menuItem("Dashboard", tabName = "dashboard",icon = icon("dashboard"), selected=T,
menuItem("Catergoria de Conta", newTab = FALSE**,selectInput(inputId = "mcm", label = "Some label", multiple = TRUE, choices = unique(tbl1$`Contas Resultado`)))**,menuItem("Unidades", newTab = FALSE )),"charts"))),