R shiny: how to specify a selectInput in html? -
i need specify selectinput() in html (in order insert them in data frame).
the reproducible code here below not provide me selectinput. in html() copy-paste html code of selectinput() obtained using 'inspect element' (and why it's not working, can't fix unfortunately)
shiny::runapp( list( ui = pagewithsidebar( headerpanel("test"), sidebarpanel( helptext('this 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){ } ) )
thank in advance cheers
inspect source code useful see how built, don't recommend copy entire section of code reuse is. use shiny functions.
but if want build select input html syntax, can use html select tag :
mainpanel( html("<select id='select'> <option value='cyl'>cyl</option> <option value='trans'>trans</option> <option value='gea'>gea</option> </select>") )
btw, in code copied : style='display: none;'
hide element (but anyway code can't work is).
Comments
Post a Comment