diff --git a/inst/ShinyApps/labestDataView/server.R b/inst/ShinyApps/labestDataView/server.R index 6ff0d52d7859aed5ef0a00f9bf7b44901c4ea631..c98ec179a7d4af7d1b40c890be7bd09007a6f35d 100644 --- a/inst/ShinyApps/labestDataView/server.R +++ b/inst/ShinyApps/labestDataView/server.R @@ -104,7 +104,7 @@ shinyServer( dig <- sapply(a, howmanydigits) print(xtable(a, digits = c(0, dig)), type = "html") } else { - cat("Selecione o conjunto de dados") + cat("Selecione o conjunto de dados.") } }) @@ -120,23 +120,35 @@ shinyServer( quote = FALSE) }) + ## Para fixar a aba selecionada + aba <- reactiveValues(x = "datasets") + observeEvent(input$TAB, { + aba$x <- input$TAB + }) + output$TABLE_DOC <- renderUI({ test <- input$DATASET == "" & is.null(input$OBRA) & is.null(input$KEYS) - if (test) { - tagList( - hr(), - includeMarkdown("ABOUT.md")## , - ## dataTableOutput("DATATABLE") - ) + if (length(test) == 0) { + includeMarkdown("ABOUT.md") } else { - tabsetPanel( - tabPanel("Lista de Datasets", - dataTableOutput("DATATABLE")), - tabPanel("Documentação", uiOutput("DOC")), - tabPanel("Tabela de dados", - tableOutput("TABLE")) - ) + if (test) { + return(includeMarkdown("ABOUT.md")) + } else { + tabsetPanel( + id = "TAB", + selected = aba$x, + tabPanel("Lista de Datasets", + dataTableOutput("DATATABLE"), + value = "datasets"), + tabPanel("Documentação", + uiOutput("DOC"), + value = "doc"), + tabPanel("Tabela de dados", + tableOutput("TABLE"), + value = "tabela") + ) + } } })