-
Notifications
You must be signed in to change notification settings - Fork 79
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 there a way to change/update the data within a table using only the JavaScript API #278
Comments
It's not possible today, but I've been thinking about adding this for a long time. The only issue before was that it was very unlikely to ever be used, considering everyone would already be using Shiny for dynamic data fetching/updating anyway. But now that Quarto is here, I can see more use cases for updating data via JavaScript, or even rendering the table through JavaScript alone. One question though - do you have your data in row or column format? By row format, I mean an array of objects like |
Thanks for the reply Yeah, the application I want to use it in is in quarto. I would be happy with either format really Thanks |
Happy to help with a PR on this, however I could only really help on the R side I'm afraid |
This is now done in 858cc8b:
I ended up adding support for either row or column formatted data, and it's autodetected by You still need to create the table in R, but if you don't have the initial data, you can use an empty data frame and call data <- data.frame(species = character(0), island = character(0), bill_length = numeric(0))
reactable(data, elementId = "tbl") If you have any fancier examples of Quarto/Observable, that would be useful too, as I've only spent a couple minutes reading about Observable and copying examples 🙂 |
thank you!! |
Another small update: I moved the Quarto example to vignettes/quarto/observable-reactable.qmd and added a bit more content. There's now also an example of using reactable to filter Observable charts/outputs using the new Demo: https://glin.quarto.pub/observable-reactable/ (this will eventually be added to the package docs) |
Firstly, thanks for a fantastic package! It is really excellent.
I would like for a table to change its content in a quarto document with ojs, depending on an input selection that chooses from different api endpoints (all datasets have the same structure, columns, etc.)
I have been trying to find a way of doing this without using crosstalk (the tables are very large, hence the api). Is it possible to accomplish this? - changing the table's state using JavaScript only?
Thanks
The text was updated successfully, but these errors were encountered: