Last active
August 29, 2015 14:02
-
-
Save jcheng5/5427d6f264408abf3049 to your computer and use it in GitHub Desktop.
Link directly to specific tab. Add ?tab=3 to the URL to jump straight to tab3, for example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output, session) { | |
# On startup, read the URL parameter | |
queryParams <- parseQueryString(isolate(session$clientData$url_search)) | |
if ('tab' %in% names(queryParams)) | |
updateTabsetPanel(session, 'tabset', selected = paste0('tab', queryParams[['tab']])) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyUI(fluidPage( | |
tabsetPanel(id = "tabset", | |
tabPanel(value = "tab1", "One"), | |
tabPanel(value = "tab2", "Two"), | |
tabPanel(value = "tab3", "Three") | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment