-
Notifications
You must be signed in to change notification settings - Fork 181
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
Change SearchPanes Button text? #804
Comments
According to the example on datatables's official site, you should use library(DT)
datatable(
iris,
options = list(
dom = 'Bfrtip',
columnDefs = list(list(searchPanes = list(show = FALSE), targets = 1:4)),
buttons = list(
'searchPanes',
list(extend = "copy", text = "Hi!")),
language = list(searchPanes = list(collapse = 'filter'))
),
extensions = c('Select', 'SearchPanes', 'Buttons')
) |
Ah - my oversight. Thank you so much for the clarification! |
I think this is also a simple question, but I don't see it in the documentation: where can I set other options for the searchPanes extension. For example to turn off all controls I thought I could add the following to options as described in the datatables documentation. My apologies if this is documented elsewhere! datatable(
iris,
options = list(
dom = 'Bfrtip',
columnDefs = list(list(searchPanes = list(show = FALSE), targets = 1:4)),
buttons = list(
'searchPanes',
list(extend = "copy", text = "Hi!")),
language = list(searchPanes = list(collapse = 'filter')),
searchPanes = list(controls = FALSE)
),
extensions = c('Select', 'SearchPanes', 'Buttons')
) |
I don't see it's documented. But it seems that when using searchPanes Buttons, you need to set the controls via So this works: library(DT)
datatable(
iris,
options = list(
dom = 'Bfrtip',
columnDefs = list(
list(searchPanes = list(show = FALSE), targets = 1:4),
list(searchPanes = list(controls = FALSE), targets = 5)
),
buttons = list(
'searchPanes',
list(extend = "copy", text = "Hi!")
),
language = list(searchPanes = list(collapse = 'filter'))
),
extensions = c('Select', 'SearchPanes', 'Buttons')
) |
Thank you again @shrektan! |
I wrote up a little blog post demonstrating some of these options. Might be useful in anyone comes across this issue! |
I'm using the new SeachPanes feature from DT along with the Buttons extension and I'm having trouble changing the text displayed on the SearchPanes button.
For other buttons, I can change the button text by using the text argument, but when I try this for SearchPanes, I can't change the text. See below for an example where I change the text of the Copy button to "Hi!", but the same does not work with the SearchPanes button.
This was posted on RStudio Community but has not received any answers.
By filing an issue to this repo, I promise that
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')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: