I have a SQL Server instance where I can successfully edit, create new and delete records using the DTedit package: https://rpubs.com/DavidFong/DTedit.
I am unable to pass in input.choices. Normally, these choices would come in from a unique list of factors from a database table, but to reprex I simply created a simple df and added a vector of choices. No matter what I put into the input.choices you can see the list of available choices does not change.
Any suggestions on how to get a list of choices into the select list on the form (not just A and B, but A, B, C, D?
library(shiny)
library(DTedit)
##### Create the Shiny server
server <- function(input, output, session) {
data <- data.frame(Column1 = c(1,2,3,4,5,6), Column2 = c('A','B','B','B','A', ''))
# edit form & delete actions which updates the database tables thru embedded call-back functions
x <- dtedit(input, output,
name = 'Data',
thedata = data,
edit.cols = c( 'Column1', 'Column2'),
edit.label.cols = c('Column1', 'Column2'),
input.types = c(Column2 = 'selectInput'),
input.choices = list(Column2 = c("A", "B", "C", "D")),
view.cols = names(data)
)}
##### Create the shiny UI
ui <- fluidPage(
uiOutput('Data'),
)
shinyApp(ui = ui, server = server)
thank you