【发布时间】:2014-03-10 16:26:24
【问题描述】:
我需要在 html 中指定一些 selectInput()(以便将它们插入数据框中)。
下面的可重现代码没有为我提供 selectInput。 HTML() 中的内容是我使用“检查元素”获得的 selectInput() 的 html 代码的复制粘贴(这可能是它不起作用的原因,但不幸的是我无法修复它)
shiny::runApp(
list(
ui = pageWithSidebar(
headerPanel("TEST"),
sidebarPanel(
helpText('This does not work:')
),
mainPanel(
HTML("<label class='control-label' for='variable' style = 'width:400px;'>Variable:</label>
<select id='variable' tabindex='-1' class='selectized shiny-bound-input' style='display: none;'><option value='toz' selected='selected'></option></select>
<div class='selectize-control single'><div class='selectize-input items full has-options has-items'><div data-value='toz' class='item'>Cyl</div><input type='text' autocomplete='off' tabindex='' style='width: 4px; opacity: 0; position: absolute; left: -10000px;'></div><div class='selectize-dropdown single' style='display: none; width: 893px; top: 36px; left: 0px; visibility: visible;'><div class='selectize-dropdown-content'><div data-value='toz' data-selectable='' class='option selected'>Cyl</div><div data-value='toztoz' data-selectable='' class='option'>Trans</div><div data-value='ge' data-selectable='' class='option'>Gea</div></div></div></div>
<script data-for='variable' type='application/json'>{}</script>")
)
)
,
server = function(input,output){
}
)
)
提前谢谢你 干杯
【问题讨论】:
-
你不能从网页中随机复制代码并期望它做你想做的事情:/
-
请提供您的实际代码或可重现的示例、除了“这里出了什么问题”之外的更具体的问题,和/或您迄今为止尝试过的事情