Using Reactable.setFilters to filter R Reactable in Quarto with OJS #351
Unanswered
erikrenz88
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have a Reactable I'm building in a Quarto document and attempting to use OJS to create filters to narrow down the Reactable. I have tried the example shown here, but this was not assigning values appropriately (rows that were meant to be filtered were showing up in place of rows that should have been retained).
I've tried to get around this by using the Reactable.setFilter and setAllFilters API calls but I am getting a TypeError: e.replace is not a function. Since the R code is largely irrelevant, I've included the OJS blocks and the elementId of the Reactable:
{ojs} //|panel: input viewof t_chosen = Inputs.select( ["a", "b", "c", "d", "e", "f"], { value: ["a"], label: "Th:"} ) viewof m_chosen = Inputs.checkbox( ["g", "h", "i", "j", "k", "NA"], { value: ["g", "h", "i", "j", "k", "NA"], multiple: true, label: "Mat:"} )
{ojs} Reactable.setAllFilters('tbl', [ { id: 'Theme', value: t_chosen }, { id: 'Overall', value: m_chosen } ])
{r, echo = F} #| column: screen-inset-shaded reactable( data, elementId = "tbl", theme = fivethirtyeight(), pagination = FALSE, defaultSorted = 'Overall' )
I was unsure about feeding multiple selections in as a single value as I'm not overly familiar with OJS. Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions