rshinydtjquery-layouthtml-templates

Shiny-App with JQueryLayout and DT-table not working


I am trying to create an app using JQuery-layouts (found here) and the htmlTemplate function from shiny.

The only thing that is not functioning for now is displaying a DT-Table on the second Tab in the center pane. The problem also remains when trying to use a normal shiny table (renderTable/tableOutput).

This div is there, but no table appears:

<div id="histoTable1" style="width:100%; height:auto; " class="datatables html-widget html-widget-output shiny-bound-output"></div>

Do I need to specify some I/O-bindings? Or what am I missing?


The app can be ound here and run via:

library(shiny)
runGitHub(repo = "jQueryLayout", username = "trafficonese")

Solution

  • Based on this answer, I managed to figure it out:

    A short javascript snippet was missing in the head, which is listening to the click event and then triggers a "shown".

    <script>
        $(document).on("click", "li.tabCenter a", function() {
            $(this).trigger("shown");
        });
    </script> 
    

    The github-example is working fine now and both tables appear.