ReporteRs (version 0.7.7)

addLinkItem: add an item in a BootstrapMenu or a DropDownMenu

Description

add an item in a BootstrapMenu or DropDownMenu object. An item can be a simple link associated with a label or a DropDownMenu object.

Usage

addLinkItem(x, label, link, dd, separator.before = FALSE,
  separator.after = FALSE, active = FALSE)

Arguments

x
a DropDownMenu or a BootstrapMenu object.
label
"character" value: label of a simple link. If used, argument link must be specified.
link
"character" value: hyperlink value. If used, argument label must be specified.
dd
a DropDownMenu object to insert into the menu. If used, arguments label and link will be ignored.
separator.before
if TRUE, a separator will be inserted before the new item. It only applies when x is a DropDownMenu object.
separator.after
if TRUE, a separator will be inserted after the new item. It only applies when x is a DropDownMenu object.
active
if TRUE, the item will be declared as active (highlighted).

Value

  • an object of class BootstrapMenu.

See Also

bsdoc, addBootstrapMenu

Examples

Run this code
#
mymenu = BootstrapMenu( title = "my title")

mydd = DropDownMenu( label = "Mon menu" )
mydd = addLinkItem( mydd, 
	label = "GitHub", "http://github.com/")
mydd = addLinkItem( mydd, separator.after = TRUE)
mydd = addLinkItem( mydd, 
	label = "Wikipedia", "http://www.wikipedia.fr")

mymenu = addLinkItem( mymenu, 
	label = "ReporteRs", "http://github.com/davidgohel/ReporteRs")
mymenu = addLinkItem( mymenu, dd = mydd )

Run the code above in your browser using DataCamp Workspace