rstudio / DT

R Interface to the jQuery Plug-in DataTables
https://rstudio.github.io/DT/
Other
598 stars 181 forks source link

R Shiny DT package won't save edited values if I set to disable some columns to be editable mode #1079

Open sound118 opened 1 year ago

sound118 commented 1 year ago

I want to use the r shiny code on https://www.r-bloggers.com/2019/04/edit-datatables-in-r-shiny-app/ as an example to regenerate the issue I am facing. Basically if I change output$mod_table <- DT::renderDataTable({ DT::datatable(v$data, editable = TRUE) })

to be like below output$mod_table <- DT::renderDataTable({ DT::datatable(v$data, editable = list(target = 'column', disable = list(columns = 1:2)), rownames = FALSE) })

observeEvent(input$saveBtn, { write.csv(df0, "/home/rstudio/Data Dictionary/BA_filled_data.csv", row.names = FALSE) })

This only allows user to edit other columns except column 1 and 2. However, when I try to save the edited data into a csv file to a certain directory, I cannot see the update data in there while I can see the update data if I use editable = TRUE. Is this a bug in DT package, or I get something wrong?

Can someone pls help with this issue? Thanks!


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

stla commented 1 year ago

Do you use the proxy?