使用index.html作为UI并不适用于eventReactive Shiny R.

时间:2016-01-28 09:58:10

标签: html r shiny action-button

在过去的两天里,我一直在努力解决这个问题,到目前为止似乎对我没有任何帮助。

我想要这段代码:用户点击searchButton,创建一个空数据框。

eventReactive在正常的UI.R上工作正常,但是当我尝试使用index.html时它不起作用。我的代码如下:

Server.R:

new_search <- eventReactive(input$searchButton, {
        search_term <<- input$searchText
test <- data.frame()
})

的index.html

<!-- Search bar -->
  <form class="sidebar-form">
                <div class="input-group">
                  <input id="searchText" type="text" class="form-control" placeholder="Ask me anything..">
                  <span class="input-group-btn">
                    <button id="searchButton" type="button" class="btn btn-flat action-button">
                      <i class="fa fa-microphone"></i>
                    </button>
                  </span>
                </div>
  </form>

请帮助:(非常感谢你

编辑:我的html模板来自此处:https://onepagelove.com/creative

我将以下代码添加到标题部分:

<!-- Shiny JS -->
<script src="shared/jquery.js" type="text/javascript"></script>
<script src="shared/shiny.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="shared/shiny.css"/>

0 个答案:

没有答案