We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the meantime, we may use shiny.setInputValue:
library(shiny) library(gentelellaShiny) options(shiny.jquery.version=1) shinyApp( ui = gentelellaPageCustom( title = "Shiny Gentelella", navbar = gentelellaNavbar(), sidebar = gentelellaSidebar( sidebarProfile( name = "Mark", img = "https://image.flaticon.com/icons/svg/236/236831.svg" ), sidebarDate(), sidebarMenu( sidebarItem( "Tab 1", tabName = "tab1" ), sidebarItem( "Tab 2", tabName = "tab2" ) ) ), body = gentelellaBody( tabItems( tabItem( tabName = "tab1", tags$head( tags$script( "$(function() { $('li a').on('click', function() { var val = $(this).attr('data-value'); Shiny.setInputValue('currentTab', val); }); // trigger click on the first item setTimeout(function(){ $('li a').first().trigger('click'); }, 10); }); " ) ), "Tab 1 content" ), tabItem( tabName = "tab2", "Tab 2 content" ) ) ), footer = gentelellaFooter() ), server = function(input, output, session) { observe(print(input$currentTab)) } )
See here to get the related post
The text was updated successfully, but these errors were encountered:
Hi, I'm new to css and html. Is it normal this does not work with dynamic tabs ?
Here is my example :
library(shiny) library(gentelellaShiny) options(shiny.jquery.version=1) shinyApp( ui = gentelellaPageCustom( title = "Shiny Gentelella", navbar = gentelellaNavbar(), sidebar = gentelellaSidebar( sidebarProfile( name = "Mark", img = "https://image.flaticon.com/icons/svg/236/236831.svg" ), sidebarDate(), sidebarMenu( uiOutput("tab11"), uiOutput("tab22") ) ), body = gentelellaBody( tabItems( tabItem( tabName = "tab1", tags$head( tags$script( "$(function() { $('li a').on('click', function() { var val = $(this).attr('data-value'); Shiny.setInputValue('currentTab', val); }); // trigger click on the first item setTimeout(function(){ $('li a').first().trigger('click'); }, 10); }); " ) ), "Tab 1 content" ), tabItem( tabName = "tab2", "Tab 2 content" ) ) ), footer = gentelellaFooter() ), server = function(input, output, session) { observe(print(input$currentTab)) output$tab22 <- renderMenu({ sidebarItem(" item 1", tabName = "tab2", icon = tags$i(class = "fas fa-exchange-alt", style = "color: rgb(255,255,255)")) }) output$tab11 <- renderMenu({ sidebarItem("Item 2", tabName = "tab1", icon = tags$i(class = "fas fa-exchange-alt", style = "color: rgb(255,255,255)")) }) } )`
Sorry, something went wrong.
DivadNojnarg
No branches or pull requests
In the meantime, we may use shiny.setInputValue:
See here to get the related post
The text was updated successfully, but these errors were encountered: