I try to add text in the blue area, the following code chunk is my bad idea. I want to show different messages by clicking different buttons or selections.
How can I use variables, such as input$uploadFileName, and show it in Blue area?
body <- dashboardBody(
useShinyjs(),
# This will call message-handler.js
tags$head(tags$script(src = "message-handler.js"),
tags$link(rel = "stylesheet", type = "text/css", href = "css/tmod.css"),
tags$style(HTML(
'.myClass {
font-size: 15px;
line-height: 50px;
text-align: left;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
padding: 0 15px;
overflow:hidden;
color:#2780e3;
}
'))),
tags$script(HTML('$(document).ready(function() {
$("header").find("nav").append(\'<span class="myClass"> Text Here </span>\');
})
')),.......
.......
Shiny.shinyapp.$inputValues{fInput:shiny.file: null, iBreak:shiny.action: 2, .clientdata_output_someText_hidden: false, .clientdata_pixelratio: 1, .clientdata_url_protocol: "http:", …}
fInput:shiny.file: null iBreak:shiny.action: 2 __proto__: Object
getValue: function(el) {
// This returns a non-undefined value only when there's a 'data-restore' // attribute, which is set only when restoring Shiny state. If a file is // uploaded through the browser, 'data-restore' gets cleared. var data = $(el).attr('data-restore'); if (data) { // blahblahblah return data;
} else { return null; } }
runApp(launch.browser = TRUE, shinyApp( ui=dashboardPage( dashboardHeader(title='Header',tags$li(class='dropdown',style='border:2px solid white;',id='headerCustomText')), dashboardSidebar(disable = TRUE), dashboardBody(fileInput(inputId = 'fInput',label = 'Upload file'), tags$script('$(document).ready( $("#fInput").on("change",function(){$("#headerCustomText").html($(".form-group.shiny-input-container input[type=text]").val())}) )'))), server=shinyServer(function(input,output){ }) ))