createDT: Create a Data Table.

Description Usage Arguments Value See Also Examples

View source: R/dt-misc.R

Description

Creates a DT DataTable based on the settings specified in the context.

Usage

1
createDT(.context)

Arguments

.context

List. The shinyXT context.

Value

A DT DataTable

See Also

formatDT

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
onetable_df <- data.frame(
    a0_num = c(1, 2, 3, 4)
)

onetable_xt <- list(
    
    .default = list(
        col_name = NA_character_,
        class = NA_character_,
        ui_name = NA_character_,
        hover = NULL,
        widget = NULL,
        format = NULL,
        column_width = 3,   
        width = "100%", 
        visible = TRUE,
        enabled = TRUE,
        validate = NULL
    ),
    
    .options = list(),
    a0_num = list(
        col_name = "a0_num",
        class = "numeric",
        ui_name = "Col A0",
        hover = "Numeric, no decimals",
        widget = "numericInput",
        format = "",
        validate = NULL
    )
)


context_default <- list(
    tbl_name = "onetable",
    tbl_lst = list(
        onetable = onetable_df
    ),
    filter_lst = NULL,
    mode = "dt",
    xt_lst = list(
        onetable = onetable_xt
    )
)

xt <- shinyXT::getConfigMode(context_default)

dt <- shinyXT::createDT(context_default)

numeract/shinyXT documentation built on May 30, 2019, 5 a.m.