简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM