Commit 0a786546 authored by Jean-Francois Rey's avatar Jean-Francois Rey
Browse files

bugfix add and rm row in tables

parent a3700aba
......@@ -195,8 +195,11 @@ editableDTServer <- function(id, DTdata, disableCol = shiny::reactiveVal(c()), c
# incremente cols
if( !is.null(row.inc) ) {
lapply(row.inc, function(x){
if( is.na(as.numeric(newline[x])) ) {newline[x] <<- paste0(newline[x],nrow(rv$data)+1)}
else{
if( is.na(as.numeric(newline[x])) ) {
j <- nrow(rv$data)+1
while( paste0(newline[x],j) %in% rv$data[,x] ) j <- j+1
newline[x] <<- paste0(newline[x],j)
} else {
val <- max(sort(as.numeric(rv$data[,x]))) +1
newline[x] <<- val
}
......
......@@ -236,7 +236,7 @@ server <- function(input, output, session) {
shiny::removeUI(selector = "#rotationPeriodError")
if (input$demo == "RO" && advanced_mode() == FALSE) {
if (input$rotationPeriod < 1 ||
input$rotationPeriod >= input$nYear ||
input$rotationPeriod > input$nYear ||
is.na(input$rotationPeriod)) {
showErrorMessage(
id = "rotationPeriodError", selectorafter = "#generateLandscape",
......@@ -246,6 +246,18 @@ server <- function(input, output, session) {
)
can_gen_landscape$rotation <<- FALSE
}
} else {
if (input$rotationPeriod < 0 ||
input$rotationPeriod > input$nYear ||
is.na(input$rotationPeriod)) {
showErrorMessage(
id = "rotationPeriodError", selectorafter = "#generateLandscape",
message = paste0(
"The rotation period should be between 1 and ", input$nYear, " (the simulation duration) or 0 for none"
)
)
can_gen_landscape$rotation <<- FALSE
}
}
can_gen_landscape$proportions <<- ProportionValidation()
can_run_simul$landscape <<- FALSE
......
......@@ -55,7 +55,7 @@ landscapeTab <- {
inputId = "rotationPeriod",
label = "Rotation period (years)",
value = 0,
max = 50
max = VALUEMAX
)
),
shinyBS::bsTooltip("rotationPeriod",title=ROTATION_PERIOD, placement = "bottom", trigger="hover"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment