1

I am new to Shiny R. Based on a Table Editor, I would like to customise certain functions but I am having some issues. There is an Add button that contains several fields. I would not like to write every time some fields to fill the form, e.g., the Supplier or product names. I tried using SelectInput from the csv file created by the app, but when clicking the add row button, there is a drop list of the Suppliers but I can't write any other name that is not in that list. I read that another option would be textInput.typeahead but I can't figure out how to make it work.

Here is the piece of code I am using:

mydata1 = read.csv("Supplier_NCR1.csv", row.names = NULL, na.strings = "", stringsAsFactors = FALSE)
mylist1 <- as.list(unique(mydata1[[4]]))

observeEvent(input$Add_row_head, {
### This is the pop up board for input a new row
showModal(modalDialog(title = "Add a new row",
                      dateInput(paste0("Date_add", input$Add_row_head), "Date:", value = Sys.Date()),
                      numericInput(paste0("ReportNo_add", input$Add_row_head), "Report Number:",0),
                      selectInput(paste0("Supplier_add", input$Add_row_head), "Supplier Name:",choices=c("",mylist1)),   

'''

Also, I do not know if it possible to read that field from the datatable itself instead of the csv file. Thank you in advance and hope to find a solution.

Lambert
  • 11
  • 1
  • The best way to get great answers quickly is to provide a reproducible example. For someone to troubleshoot your issue, they will probably need to see your programming code. To write a great question, read about how to make reproducible examples for R here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Kat Aug 06 '21 at 02:44

0 Answers0