Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks
sound118 opened this issue Jul 26, 2023 · 1 comment

Comments

@sound118
Copy link

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 have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('DT'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/DT').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

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

@stla
Copy link
Collaborator

stla commented Jul 28, 2023

Do you use the proxy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants