From 218567f28e121a00c0290de0dc995a460de15101 Mon Sep 17 00:00:00 2001 From: Millicool Date: Mon, 8 Dec 2025 19:43:39 +0100 Subject: [PATCH] Change selection from drop down --- IT Shiny App.R | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/IT Shiny App.R b/IT Shiny App.R index 841dea1..d52bfbb 100644 --- a/IT Shiny App.R +++ b/IT Shiny App.R @@ -131,9 +131,23 @@ server <- function(input, output, session){ updateSelectInput( session, inputId = "drp_stadtteil", - choices = sel_stadtteile, - selected = sel_stadtteile[1] + choices = sort(sel_stadtteile), + selected = selected_stadtteil, ) + currently_selected_bezirk <<- sel_bezirk + currently_selected_stadtteil <<- selected_stadtteil + update_selection_text(output) + update_selection_table(output) + + } + }) + + observeEvent(input$drp_stadtteil, { + sel_stadtteil <- input$drp_stadtteil + if (sel_stadtteil != "") { + currently_selected_stadtteil <<- sel_stadtteil + update_selection_text(output) + update_selection_table(output) } }) @@ -162,7 +176,7 @@ server <- function(input, output, session){ rest_of_name <- get_map_layer_name(clicked_polygon_id) if (prefix == "bez_") { currently_selected_bezirk <<- rest_of_name - currently_selected_stadtteil <<- "Alle" + currently_selected_stadtteil <<- paste("Bezirk", rest_of_name) } if(prefix == "std_") { currently_selected_bezirk <<- get_bezirk_by_stadtteil(rest_of_name)