2626# ' `list(searching = FALSE, pageLength = 30, lengthMenu = c(5, 15, 30, 100), scrollX = TRUE)`
2727# ' @param server_rendering (`logical`) should the data table be rendered server side
2828# ' (see `server` argument of [DT::renderDataTable()])
29- # ' @param decorators `r roxygen_decorators_param("tm_data_table")`
3029# '
3130# ' @inherit shared_params return
3231# '
33- # ' @section Decorating `tm_data_table`:
34- # '
35- # ' This module generates the following objects, which can be modified in place using decorators:
36- # ' - `table` ([DT::datatable()])
37- # '
38- # ' For additional details and examples of decorators, refer to the vignette
39- # ' `vignette("decorate-modules-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
40- # '
4132# ' @examplesShinylive
4233# ' library(teal.modules.general)
4334# ' interactive <- function() TRUE
@@ -105,8 +96,7 @@ tm_data_table <- function(label = "Data Table",
10596 ),
10697 server_rendering = FALSE ,
10798 pre_output = NULL ,
108- post_output = NULL ,
109- decorators = NULL ) {
99+ post_output = NULL ) {
110100 message(" Initializing tm_data_table" )
111101
112102 # Start of assertions
@@ -132,8 +122,6 @@ tm_data_table <- function(label = "Data Table",
132122 checkmate :: assert_multi_class(pre_output , c(" shiny.tag" , " shiny.tag.list" , " html" ), null.ok = TRUE )
133123 checkmate :: assert_multi_class(post_output , c(" shiny.tag" , " shiny.tag.list" , " html" ), null.ok = TRUE )
134124
135- decorators <- normalize_decorators(decorators )
136- assert_decorators(decorators , null.ok = TRUE , " table" )
137125 # End of assertions
138126
139127 ans <- module(
@@ -146,8 +134,7 @@ tm_data_table <- function(label = "Data Table",
146134 datasets_selected = datasets_selected ,
147135 dt_args = dt_args ,
148136 dt_options = dt_options ,
149- server_rendering = server_rendering ,
150- decorators = decorators
137+ server_rendering = server_rendering
151138 ),
152139 ui_args = list (
153140 pre_output = pre_output ,
@@ -197,8 +184,7 @@ srv_page_data_table <- function(id,
197184 variables_selected ,
198185 dt_args ,
199186 dt_options ,
200- server_rendering ,
201- decorators ) {
187+ server_rendering ) {
202188 checkmate :: assert_class(data , " reactive" )
203189 checkmate :: assert_class(isolate(data()), " teal_data" )
204190 moduleServer(id , function (input , output , session ) {
@@ -251,8 +237,7 @@ srv_page_data_table <- function(id,
251237 ui_data_table(
252238 id = session $ ns(x ),
253239 choices = choices ,
254- selected = variables_selected ,
255- decorators = decorators
240+ selected = variables_selected
256241 )
257242 )
258243 )
@@ -274,19 +259,15 @@ srv_page_data_table <- function(id,
274259 if_distinct = if_distinct ,
275260 dt_args = dt_args ,
276261 dt_options = dt_options ,
277- server_rendering = server_rendering ,
278- decorators = decorators
262+ server_rendering = server_rendering
279263 )
280264 }
281265 )
282266 })
283267}
284268
285269# UI function for the data_table module
286- ui_data_table <- function (id ,
287- choices ,
288- selected ,
289- decorators ) {
270+ ui_data_table <- function (id , choices , selected ) {
290271 ns <- NS(id )
291272
292273 if (! is.null(selected )) {
@@ -298,7 +279,6 @@ ui_data_table <- function(id,
298279 tagList(
299280 teal.widgets :: get_dt_rows(ns(" data_table" ), ns(" dt_rows" )),
300281 fluidRow(
301- ui_decorate_teal_data(ns(" decorator" ), decorators = select_decorators(decorators , " table" )),
302282 teal.widgets :: optionalSelectInput(
303283 ns(" variables" ),
304284 " Select variables:" ,
@@ -322,8 +302,7 @@ srv_data_table <- function(id,
322302 if_distinct ,
323303 dt_args ,
324304 dt_options ,
325- server_rendering ,
326- decorators ) {
305+ server_rendering ) {
327306 moduleServer(id , function (input , output , session ) {
328307 iv <- shinyvalidate :: InputValidator $ new()
329308 iv $ add_rule(" variables" , shinyvalidate :: sv_required(" Please select valid variable names" ))
@@ -367,15 +346,9 @@ srv_data_table <- function(id,
367346 )
368347 })
369348
370- decorated_data_table_data <- srv_decorate_teal_data(
371- id = " decorator" ,
372- data = data_table_data ,
373- decorators = select_decorators(decorators , " table" )
374- )
375-
376349 output $ data_table <- DT :: renderDataTable(server = server_rendering , {
377350 teal :: validate_inputs(iv )
378- req(decorated_data_table_data ())[[" table" ]]
351+ req(data_table_data ())[[" table" ]]
379352 })
380353 })
381354}
0 commit comments