Open phileas-condemine opened 5 years ago
Thanks for the reporting. I think the reason is documented in language.url. So yes, you need to provide the callback in options = list(initComplete = #your callback#)
.
Note that when this parameter is set, DataTables' initialisation will be asynchronous due to the Ajax data load. That is to say that the table will not be drawn until the Ajax request as completed. As such, any actions that require the table to have completed its initialisation should be placed into the initComplete callback.
I planed to update the example using your solution (or document this) but what surprise me is that your solution won't work if this line (,language = list(url = '//cdn.datatables.net/plug-ins/1.10.11/i18n/French.json')
) gets removed.
I'll come back later.
I tried to make a slight change to the example app of @yihui https://yihui.shinyapps.io/DT-radio/ to add the language option from url ('//cdn.datatables.net/plug-ins/1.10.11/i18n/French.json') in
renderDataTable
, but the app no longer returned the months radio input. More details in the related question on SO : https://stackoverflow.com/questions/56780937/r-shiny-dt-with-radio-buttons-breaks-when-adding-language-option Someone found a trick to make it work by moving theShiny.unbindAll
&Shiny.bindAll
in theinitComplete
script rather that in thecallback
.Here is the code that doesn't work (simply adding the
language
option)Here is my
session_info()
Here is the fix (need to change ouput$foo only)
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.