I have a sidebar where I have a inputSelect with items from my list. In the main part of Shiny, I would like to see the table changing when I change my choose in the inputSelect. I managed to do this with normal text in the header. Any one
#App
library(shiny)
ui <- fluidPage(
headerPanel(" "),
sidebarLayout(
sidebarPanel(
h4 ("Selecteer een klant uit lijst"),
selectInput("select",
label = "Kies een klant",
choices = list.Hikerlocaties,
selected = 0),
# checkboxInput("Student", "Alleen studenten", value = TRUE),
actionButton("zoek", "Zoek")
),
mainPanel(
textOutput("select"),
datatable(SelectedKlant, options = list(pageLength = 20, dom = 'tip', order = list(2,'desc')), rownames = FALSE, width = 500, colnames = c('Naam', 'Klant', 'Aantal'), elementId = "results")
)))
server <- function(input, output) {
output$select <- renderText(input$select)
SelectedKlant <- reactive({
a <- subset(freq3, Klantref == input$select)
return(a)
})
output$results <- renderDataTable(SelectedKlant, options = list(pageLength = 20, dom = 'tip', order = list(2,'desc')), rownames = FALSE, width = 500, colnames = c('Naam', 'Klant', 'Aantal'), elementId = "results")
}
# Run the application
shinyApp(ui = ui, server = server)