shinyWidgets icon indicating copy to clipboard operation
shinyWidgets copied to clipboard

shinyWidgets support inside a DT

Open michaelhogersnplm opened this issue 1 year ago • 0 comments

Hi there,

I was wondering if it is feasible to render the shinyWidgets::dropMenu inside a DT? I have attempted it with the escape = FALSE option (so it renders HTML) for DT and some loading of dependencies, but could not manage the popper/tippy functionality to work as expected.

I saw https://stackoverflow.com/a/58025486 (note that the src in htmltools::htmlDependency("shinyWidgets", "0.4.5", src = "www") is outdated, should be "assets") and wanted to apply the same approach. I saw that the dropMenu attaches dependencies via:

  htmltools::attachDependencies(
    x = attachShinyWidgetsDep(dropTag),
    value = list(
      html_dependencies_popper(),
      html_dependencies_tippy()
    ),
    append = TRUE
  )

Is it possible to provide some information on initialising a dropMenu in the context of a DT? And perhaps a more general approach that would work for any shinyWidgets element? Happy to provide an example app showcasing this if it is of use

Best regards, Michael

michaelhogersnplm avatar Mar 10 '23 10:03 michaelhogersnplm