1

在过去的 2 天里,我一直在努力解决这个问题,到目前为止似乎没有什么对我有用。

我想要这段代码做什么:用户单击搜索按钮,创建一个空数据框。

eventReactive 在普通 UI.R 上对我来说很好,但是当我尝试使用 index.html 时它不起作用。我的代码如下:

服务器.R:

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

索引.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"/>
4

0 回答 0