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

Is it possible to save the state of the user-modified reactable to a data frame (or file) [Feature]: #47

Open
1 task done
chrisumphlett opened this issue Nov 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@chrisumphlett
Copy link

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Description

I'm using rhandsontable to allow end users to update values of a table in a shiny app, and then save it to a file. But the UX is terrible, when deployed to Posit Connect (other users have reported this on its GH). I had to replace a nice reactable with that. I'm hoping I can have both the aesthetics and functionality of reactable with the ability to modify and save.

Problem

Wanting a user to update info and have it persist to the next time they access it (by saving it somewhere and using that to update the source data).

Proposed Solution

I don't know if this is possible currently or not. An out of the box function would be used by many people I think, but if I can do something manually now I'd like to (and/or I can help contribute to this development).

Alternatives Considered

rhandsontable is the only package I've found to do this, it has a glitchy UI when deployed to a server and it has not been updated for a long time.

@chrisumphlett chrisumphlett added the enhancement New feature or request label Nov 28, 2023
@chrisumphlett
Copy link
Author

chrisumphlett commented Nov 28, 2023

A not very good, but possible workaround. Write out output$text to a file and then parse that.

I modified the custom inputs sample code like this:

output$text <- renderText({
      req(input$text)
      message(getwd())
      sink("reactable_extras.log", append = TRUE)
      values <- input$text
      print(paste0(
        "Text: ",
        string_list(values)
      ))
      sink()
    })

Then, as I make changes in the text column, each change in character is logged.
image

I could take the last row for each distinct row : N... column : X group and try and use that to go back and update the source data.
The effort it would take for me to do this is probably prohibitive, given the likely shaky outcome (at best). I would have significant downstream work to do as well, because my current process saves a file to Azure blob storage, then uses Azure data factory to upsert that file to a database.

@fabrizioTerrAria
Copy link

Hi @chrisumphlett, this would be a very usefull feature.
Did you find a solution for your problem ?
Thank you very much.
Fabrizio

@chrisumphlett
Copy link
Author

No. Admittedly, I haven't tried. I watched a portion of a webinar from Posit about using the DT package.
Before trying with reactable I had implemented with rhandsontable I believe it was called. Very buggy when deployed to Posit Connect though it worked fine locally (Shiny app). That package hadn't been updated for years.

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

No branches or pull requests

2 participants