Hello,
So this solved it. Converted it into a shiny example:
library(shiny)
library(rhandsontable)
ui <- fluidPage(rHandsontableOutput('table')))
server <- function(input, output,session) {
df <- eventReactive( input$table, {
if (is.null(input$table)) {
dfOld <<- df <- data.frame(Parameter=c('A','B','C'),
Min=c(10,20,30),
Max=c(20,30,40),
Selected=c(0,0,0))
} else {
df <- hot_to_r(input$table)
if (all(df$Selected >= df$Min |
df$Selected == 0) & all(df$Selected <= df$Max)) {
df$Selected <- df$Selected
} else {
df$Selected <- dfOld$Selected
}
}
dfOld <<- df
df
}, ignoreNULL = F)
output$table<-renderRHandsontable({
if (is.null(df())) return()
rhandsontable(df())
})
}
shinyApp(ui, server)