Shiny-App with JQueryLayout and DT-table not working

143 views Asked by At

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).

  • On the tab "Graph" a plotly barchart and a DT-table appear. (works correctly)
  • On the tab "Tabelle" another DT-table should also appear. (doesnt work)

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")
1

There are 1 answers

0
SeGa On BEST ANSWER

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.