How to save the 'rhandsontable' output in a data frame?

1.6k views Asked by At

I want to display my existing dataframe in output. In addition to those columns, I need few columns where user input can be recorded. I am able to achieve this through rHandsontable. But, am not able to save the edited/modified table in a dataframe.

Below is the code am using:

    library(shiny)
library(rhandsontable)

mydf<-read.csv('C:/Bhargav/GM/01_Projects/02_Toolkit/04_Validation/Sample_part_number_4.csv')


ui<-fluidPage(
  rHandsontableOutput("df"),
  actionButton("save", "Save table")

)

server<-function(input,output) {

  values <- reactiveValues()

  output$df<-renderRHandsontable({

    DF = data.frame(mydf$PART_NBR,
                    Flag = "Valid/Invalid",
                    reason = "Enter the reason"
    )
    charac = c("Valid","Invalid")
    rhandsontable(DF,width=600, height = 400) %>% hot_col(col = "Flag", type = "dropdown",source=charac) %>% hot_col(col = "reason", allowInvalid = TRUE)

  })


}

runApp(list(ui=ui, server=server))
0

There are 0 answers