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

shiny force croptypes ID to start at 0 and be a sequence

parent 82b4016a
......@@ -220,7 +220,7 @@ editableDTServer <- function(id, DTdata, disableCol = shiny::reactiveVal(c()), c
# DT::replaceData(data = cbind(rv$data, deleteButton(rv$data, "button", ns("deletePressed"))), resetPaging = FALSE, rownames = FALSE)
# } else {
proxy %>%
DT::replaceData(data = rv$data, resetPaging = FALSE, rownames=rownames)
DT::replaceData(data = rv$data, resetPaging = TRUE, rownames=rownames)
# }
})
......@@ -240,7 +240,7 @@ editableDTServer <- function(id, DTdata, disableCol = shiny::reactiveVal(c()), c
shiny::isolate(rv$data <- cbind(rv$data[,-ncol(rv$data), drop=FALSE], deleteButton(rv$data, "button", ns("deletePressed"))))
proxy %>%
DT::replaceData(data = rv$data, resetPaging = FALSE, rownames=rownames)
DT::replaceData(data = rv$data, resetPaging = TRUE, rownames=rownames)
}
}
)
......
......@@ -845,7 +845,7 @@ server <- function(input, output, session) {
}),
disableCol = shiny::reactive({
if (isTRUE(advanced_mode())) {
c()
c("croptypeID")
} else {
names(simul_params_croptypes())
# print(names(simul_params_croptypes()))
......@@ -887,6 +887,7 @@ server <- function(input, output, session) {
can_gen_landscape$croptypeID <<- FALSE
}
else {
croptypesTable$data[,"croptypeID"] <- seq(1:nrow(croptypesTable$data))-1
output$rotationText <- renderUI({HTML(setRotationText(croptypesTable$data[, 2]))})
simul_params <<- setCroptypes(simul_params, croptypesTable$data[, 1:(ncol(croptypesTable$data) - 2)])
can_run_simul$croptypes <<- TRUE
......
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