createPSAlert {periscope2} | R Documentation |
Display alert panel at specified location
Description
Create an alert panel in server code to be displayed in the specified UI selector location
Usage
createPSAlert(
session = shiny::getDefaultReactiveDomain(),
id = NULL,
selector = NULL,
options
)
Arguments
session |
Shiny session object |
id |
Anchor id (either id or selector only should be set) |
selector |
Character vector represents jQuery selector to add the alert to is (i.e ".alertClass", div.badge-danger.navbar-badge). If 'id' is specified, this parameter will be neglected |
options |
List of options to pass to the alert |
Value
html div and inserts it in the app DOM
Shiny Usage
Call this function from program/server_local.R
or any other server file to setup the needed alert
See Also
periscope2:set_app_parameters()
periscope2:get_url_parameters()
Examples
library(shiny)
library(bs4Dash)
# Inside server_local.R
createPSAlert(id = "sidebarRightAlert",
options = list(title = "Right Side",
status = "success",
closable = TRUE,
content = "Example Basic Sidebar Alert"))
# Test se
## a div with class "badge-danger.navbar-badge" must be exist in UI to display alert
selector <- "div.badge-danger.navbar-badge"
createPSAlert(selector = selector,
options = list(title = "Selector Title",
status = "danger",
closable = TRUE,
content = "Selector Alert"))
[Package periscope2 version 0.2.3 Index]