Is there a way in which we can make the sidebarMenu -> menuItems dynamic?
Is there a way in which we can make the sidebarMenu -> menuItems dynamic? I'm making a ShinyDashboard program and I have some troubles in finding a way to make a loop in the MenuItems. Specifically, I am looking for something that can replace the following lines: menuItem( "Section1", tabName = "Section1", startExpanded = T, menuSubItem("Sub Menu 1", tabName = "tab1"), menuSubItem("Sub Menu 2", tabName = "tab2") ), menuItem( "Section2", tabName = "Section2", startExpanded = T, menuSubItem("Sub Menu 1", tabName = "tab1"), menuSubItem("Sub Menu 2", tabName = "tab2") ) Here is what I tried : lapply(1:2, function(i){ do.call(menuItem, c(text = paste0("Section",i), tabName =paste0("Section",i), startExpanded = T, lapply(1:2, function(j) { menuSubItem(text = paste0("sub menu ", j), tabName...
