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
@@ -106,8 +97,7 @@ tm_data_table <- function(label = "Data Table",
10697 ),
10798 server_rendering = FALSE ,
10899 pre_output = NULL ,
109- post_output = NULL ,
110- decorators = NULL ) {
100+ post_output = NULL ) {
111101 message(" Initializing tm_data_table" )
112102
113103 # Start of assertions
@@ -138,8 +128,6 @@ tm_data_table <- function(label = "Data Table",
138128 checkmate :: assert_multi_class(pre_output , c(" shiny.tag" , " shiny.tag.list" , " html" ), null.ok = TRUE )
139129 checkmate :: assert_multi_class(post_output , c(" shiny.tag" , " shiny.tag.list" , " html" ), null.ok = TRUE )
140130
141- decorators <- normalize_decorators(decorators )
142- assert_decorators(decorators , null.ok = TRUE , " table" )
143131 # End of assertions
144132
145133 ans <- module(
@@ -152,8 +140,7 @@ tm_data_table <- function(label = "Data Table",
152140 datanames = datanames ,
153141 dt_args = dt_args ,
154142 dt_options = dt_options ,
155- server_rendering = server_rendering ,
156- decorators = decorators
143+ server_rendering = server_rendering
157144 ),
158145 ui_args = list (
159146 pre_output = pre_output ,
@@ -203,8 +190,7 @@ srv_page_data_table <- function(id,
203190 variables_selected ,
204191 dt_args ,
205192 dt_options ,
206- server_rendering ,
207- decorators ) {
193+ server_rendering ) {
208194 checkmate :: assert_class(data , " reactive" )
209195 checkmate :: assert_class(isolate(data()), " teal_data" )
210196 moduleServer(id , function (input , output , session ) {
@@ -256,8 +242,7 @@ srv_page_data_table <- function(id,
256242 ui_data_table(
257243 id = session $ ns(x ),
258244 choices = choices ,
259- selected = variables_selected ,
260- decorators = decorators
245+ selected = variables_selected
261246 )
262247 )
263248 )
@@ -279,19 +264,15 @@ srv_page_data_table <- function(id,
279264 if_distinct = if_distinct ,
280265 dt_args = dt_args ,
281266 dt_options = dt_options ,
282- server_rendering = server_rendering ,
283- decorators = decorators
267+ server_rendering = server_rendering
284268 )
285269 }
286270 )
287271 })
288272}
289273
290274# UI function for the data_table module
291- ui_data_table <- function (id ,
292- choices ,
293- selected ,
294- decorators ) {
275+ ui_data_table <- function (id , choices , selected ) {
295276 ns <- NS(id )
296277
297278 if (! is.null(selected )) {
@@ -303,7 +284,6 @@ ui_data_table <- function(id,
303284 tagList(
304285 teal.widgets :: get_dt_rows(ns(" data_table" ), ns(" dt_rows" )),
305286 fluidRow(
306- ui_decorate_teal_data(ns(" decorator" ), decorators = select_decorators(decorators , " table" )),
307287 teal.widgets :: optionalSelectInput(
308288 ns(" variables" ),
309289 " Select variables:" ,
@@ -327,8 +307,7 @@ srv_data_table <- function(id,
327307 if_distinct ,
328308 dt_args ,
329309 dt_options ,
330- server_rendering ,
331- decorators ) {
310+ server_rendering ) {
332311 moduleServer(id , function (input , output , session ) {
333312 iv <- shinyvalidate :: InputValidator $ new()
334313 iv $ add_rule(" variables" , shinyvalidate :: sv_required(" Please select valid variable names" ))
@@ -372,15 +351,9 @@ srv_data_table <- function(id,
372351 )
373352 })
374353
375- decorated_data_table_data <- srv_decorate_teal_data(
376- id = " decorator" ,
377- data = data_table_data ,
378- decorators = select_decorators(decorators , " table" )
379- )
380-
381354 output $ data_table <- DT :: renderDataTable(server = server_rendering , {
382355 teal :: validate_inputs(iv )
383- req(decorated_data_table_data ())[[" table" ]]
356+ req(data_table_data ())[[" table" ]]
384357 })
385358 })
386359}
0 commit comments