闪亮调用模块时重置输入

时间:2019-07-19 16:50:35

标签: javascript r shiny

我有一个闪亮的模块,其中我将textInput个性化为以下波纹管:

                        HTML(sprintf("<div class=\"form-group shiny-input-container\" style = \"width:%s\">  
                                    <input id=\"%s\" 
                                    type=\"text\" class=\"form-control\" value=\"%s\" style = \"background-image:url(search.png); background-size: 30px 30px; background-position: 
                                     0%% 50%%; background-repeat: no-repeat; padding: 0 0 0 35px;\"
                                    onkeydown=\"Shiny.setInputValue('%s_jsrow', [event.keyCode,event.timeStamp]);        
                                    return (event.keyCode >=65 && event.keyCode <= 90)|| event.keyCode == 8
                                     ||(event.keyCode >=37 && event.keyCode <= 40)||event.keyCode == 222||(event.keyCode >=33 && event.keyCode <= 34)
                                     ||event.keyCode == 46||event.keyCode == 45||event.keyCode == 16||event.keyCode == 9||event.keyCode == 13
                                     || event.keyCode == 59|| event.keyCode == 20||event.keyCode == 32||(event.keyCode >=16 && event.keyCode <= 18)
                                     ||event.keyCode == 173||event.keyCode == 0||(event.keyCode >=112 && event.keyCode <= 123)||event.keyCode == 219;\" required/>
                                     <label class=\"form-control-placeholder\" for=\"%s\">%s</label>
                                     </div>",
                                     addWidth, ns("textInputPlaceholderMoveUpServer"), addValue, ns("textInputPlaceholderMoveUpServer"),ns("textInputPlaceholderMoveUpServer"), addLabel)
                        )

但是,当我多次调用此模块时,变量textInputPlaceholderMoveUpServer_jsrow不会重置其值。我该如何改善呢?

谢谢!

0 个答案:

没有答案