Description Usage Arguments Value See Also Examples
Use this after initMessageData to add a message when stuff happens Icons from shinydashboard functions
1 2 | addMessageData(messageData, addText, addIcon = "users",
addStatus = "success")
|
messageData |
Pass in the existing messageObject created by initMessageData. |
addText |
The message to add. |
addIcon |
Icon taken from shinydashboard. See Details. |
addStatus |
Color of message, see Details. |
Nothing.
http://rstudio.github.io/shinydashboard/appearance.html#icons
Other message functions: initMessageData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run:
## server.r
shinyServer(function(input, output, session) {
messageData <- initMessageData()
addMessageData(messageData, "A new message!")
output$messageMenu <- renderDropdownMenu({
message_df <- data.frame(text = messageData$text,
icon = messageData$icon,
status = messageData$status)
msgs <- apply(message_df, 1, function(row){
notificationItem(text = row[['text']],
icon = icon(row[['icon']]),
status = row[['status']])
})
dropdownMenu(type="notifications", .list = msgs)
})
}
## ui.r
dashboardHeader(title = "GA Forecast",
dropdownMenuOutput("messageMenu"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.