addMessageData: addMessageData - creates another Message object

Description Usage Arguments Value See Also Examples

Description

Use this after initMessageData to add a message when stuff happens Icons from shinydashboard functions

Usage

1
2
addMessageData(messageData, addText, addIcon = "users",
  addStatus = "success")

Arguments

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.

Value

Nothing.

See Also

http://rstudio.github.io/shinydashboard/appearance.html#icons

Other message functions: initMessageData

Examples

 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)

MarkEdmondson1234/shinyga documentation built on May 7, 2019, 3:34 p.m.