代码之家  ›  专栏  ›  技术社区  ›  Endre mr. fixit

获取特定的HTMLWidget

  •  0
  • Endre mr. fixit  · 技术社区  · 6 年前

    如果有多个小部件可用,我需要使以下代码更加健壮:

    tbl = this.HTMLWidgets.widgets[0]
    

    第一次尝试:

    tbl = this.HTMLWidgets.widgets.filter(function(widget) {
    // this should match the table id specified in the shiny app
    return widget.name === "hot"
    })[0];
    

    但是,它不会产生正确的小部件。我应该如何改进代码,如何列出所有可用的小部件?

    更多细节: Passing parameter to custom renderer in rhandsontable does not work inside a Shiny App

    0 回复  |  直到 6 年前