Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CSIRO-INRA
landsepi
Commits
ec8f3320
Commit
ec8f3320
authored
Jun 22, 2021
by
Jean-Francois Rey
☕
Browse files
shiny force croptypes ID to start at 0 and be a sequence
parent
82b4016a
Changes
2
Hide whitespace changes
Inline
Side-by-side
inst/shiny-landsepi/modules/editableDT.R
View file @
ec8f3320
...
...
@@ -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
=
FALS
E
,
rownames
=
rownames
)
DT
::
replaceData
(
data
=
rv
$
data
,
resetPaging
=
TRU
E
,
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
=
FALS
E
,
rownames
=
rownames
)
DT
::
replaceData
(
data
=
rv
$
data
,
resetPaging
=
TRU
E
,
rownames
=
rownames
)
}
}
)
...
...
inst/shiny-landsepi/server.R
View file @
ec8f3320
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment