mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
methods: Automatically change to custom weighting
This commit is contained in:
parent
2bf96ffd38
commit
471f2773aa
1 changed files with 10 additions and 3 deletions
13
R/methods.R
13
R/methods.R
|
|
@ -45,11 +45,18 @@ methods_server <- function(id, analysis) {
|
||||||
moduleServer(id, function(input, output, session) {
|
moduleServer(id, function(input, output, session) {
|
||||||
# Observe each method's enable button and synchronise the slider state.
|
# Observe each method's enable button and synchronise the slider state.
|
||||||
lapply(methods, function(method) {
|
lapply(methods, function(method) {
|
||||||
observeEvent(c(input[[method$id]], input$optimization_target), {
|
observeEvent(input[[method$id]], {
|
||||||
shinyjs::toggleState(
|
shinyjs::toggleState(
|
||||||
sprintf("%s_weight", method$id),
|
sprintf("%s_weight", method$id),
|
||||||
condition = input$optimization_target == "custom" &
|
condition = input[[method$id]]
|
||||||
input[[method$id]]
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
shinyjs::onclick(sprintf("%s_weight", method$id), {
|
||||||
|
updateSelectInput(
|
||||||
|
session,
|
||||||
|
"optimization_target",
|
||||||
|
selected = "custom"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue