ContentList: Content List

Description Usage Methods

Description

R6Class for storing content in a list. Note that this$container() and this$set_session(session) must be called in order for the content list to work properly.

Usage

1
content_list <- ContentList$new("content")

Methods

new(id, sortable = FALSE)

Initialize the content list.

id Character. The id of the content list's container. If the session associated with the content list is a session proxy (session inside of a module), the id gets namespaced.
sortable Currently defunct.
container()

Call this function in the UI definition. This function returns the div-element containing the content list.

set_session(session)

Call this function in the server function to connect the content list with a session.

session A shiny session object.
add_content_element(content_element, hidden = TRUE)

Add a content element to the content list.

content_element A content element object.
hidden If TRUE, this content element starts in a hidden state. Use this$show_content_element() to show it.
append_tab(content_element_id, tab, select = FALSE, closeable = FALSE)

Append a tab to the content element with id == content_element_id.

content_element_id Character. The id of the content element.
tab The item to be added (must be created with tabPanel).
select If TRUE tab gets selected upon being inserted.
closeable If TRUE, tabPanel is closeable via an button with cross icon next to the tabPanel's title.
get_content_element(content_element_id)

Get the content element with id == content_element_id.

get_content_element_ids()

Get the ids of the content elements as a character vector.

hide_content_element(content_element_id)

Hide the content element with id == content_element_id.

remove_tab(content_element_id, target)

Dynamically remove a tabPanel from an existing content element.

content_element_id Id of content element.
target The value of the tabPanel to be removed.
show_content_element(content_element_id)

Show the content element with id == content_element_id.

update_tab(content_element_id, selected)

Update the selected tab of the content element with id == content_element_id

.


DavidBarke/QWUtils documentation built on Jan. 13, 2020, 11:52 a.m.