Commit 3fa421e0 authored by jlopez's avatar jlopez
Browse files

update inputs

parent fb6ccf5f
......@@ -7,7 +7,8 @@ tabinputs = fluidPage(
radioButtons("radioButtons1",label = "Radio buttons 1 :", choices = list("Choice A" = "A", "Choice B" = "B", "Choice C" = "C"), selected = "C", width = "50%"),
checkboxInput("checkboxInput1", label = "Single Checkbox input 1 :", value = TRUE),
p("Just simple text for description or help"),
checkboxGroupInput("checkboxGroupInput1",label = "Group checkbox input 1 :", choices = list("Choice A" = "A", "Choice B" = "B", "Choice C" = "C"), selected = "C", width = "50%"),
checkboxGroupInput("checkboxGroupInput1",label = "Group checkbox input 1 :", choices = list("Choice A" = "A", "Choice B" = "B", "Choice C" = "C"), selected = "C", width = "50%"),
fileInput("fileInput1", label = "Chose file", accept = c(".csv", ".xslx"), multiple = FALSE, width = "50%"),
actionButton("runP", "Run", icon("save"), class="btn btn-primary")
)
#' Event when use runP button
observeEvent(input$runP, {
print(input$fileInput1)
})
......@@ -114,6 +114,14 @@ App:
label: "Choice C"
value: "C"
-
type: "fileInput"
id: "fileInput1"
label: "Chose file"
multiple: FALSE
width: "50%"
accept: [".csv", ".xslx"]
-
class: "btn btn-primary"
icon: "save"
......
......@@ -125,13 +125,39 @@ generate_pages_server <- function() {
if(ch < length(cnt$choices)) {
res <- res + '"' + choices$label + '"' + ' = ' + value + ', '
} else {
res <- res + '"' + choices$label + '"' + ' = ' + value + '), '
res <- res + '"' + choices$label + '"' + ' = ' + value
}
}
}
res <- res + ' selected = "'+cnt$selected+'"' + ', width = "'+ cnt$width +'")'
res <- res + '), selected = "'+cnt$selected+'"' + ', width = "'+ cnt$width +'")'
} else if(cnt$type == "fileInput") {
res <- res + '\tfileInput("'+ cnt$id +'", label = "'+ cnt$label + '"'
if(length(cnt$accept) > 0) {
res <- res + ", accept = c("
for(a in 1:length(cnt$accept)){
form <- cnt$accept[[a]]
res <- res + '"' + form + '"'
if(a < length(cnt$accept)) {
res <- res + ', '
} else {
res <- res + ')'
}
}
}
res <- res + ', multiple = ' + cnt$multiple + ', width = "'+ cnt$width + '")'
}
......
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