【问题标题】:Shiny-App with JQueryLayout and DT-table not working带有 JQueryLayout 和 DT-table 的 Shiny-App 不起作用
【发布时间】:2018-09-21 09:59:04
【问题描述】:

我正在尝试使用 JQuery-layouts(找到 here)和来自 shiny 的 htmlTemplate 函数创建一个应用程序。

目前唯一不起作用的是在中心窗格的第二个选项卡上显示 DT-Table。尝试使用普通闪亮表 (renderTable/tableOutput) 时,问题仍然存在。

  • 在“图形”选项卡上会出现一个条形图和一个 DT 表。 (正常工作)
  • “Tabelle”选项卡上还应出现另一个 DT 表。 (不起作用

这个 div 存在,但没有表格出现:

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

我需要指定一些 I/O 绑定吗?或者我错过了什么?


该应用可以在here 找到并通过以下方式运行:

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

【问题讨论】:

    标签: r shiny dt jquery-layout html-templates


    【解决方案1】:

    基于这个answer,我设法弄清楚了:

    头部缺少一个简短的javascript sn-p,它正在侦听点击事件,然后触发“显示”。

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

    github-example 现在工作正常,两个表都出现了。

    【讨论】:

      猜你喜欢
      • 2019-01-20
      • 1970-01-01
      • 2018-08-09
      • 2021-06-25
      • 2018-02-06
      • 2017-09-01
      • 2015-09-27
      • 2016-05-22
      • 1970-01-01
      相关资源
      最近更新 更多