@@ -598,10 +598,25 @@ listings_server <- function(module_id,
598598 targets = review_column_indices [[4 ]])
599599 )
600600 )
601+
602+ # TODO: find a place for this if
603+ if (checkmate :: test_string(input [[REV $ ID $ ROLE ]], min.chars = 1 )) {
604+ bulk_render <- sprintf(
605+ " function(settings, json) {
606+ dv_listings.render_bulk_menu(settings.sTableId + \" _wrapper\" , [%s], '%s');
607+ }" , paste(paste0(" '" , review [[" choices" ]], " '" ), collapse = " , " ),
608+ ns(REV $ ID $ REVIEW_SELECT )
609+ )
610+ } else {
611+ bulk_render <- " "
612+ }
601613 } else {
614+ bulk_render <- " "
602615 review_col_count <- 0
603616 }
604617
618+
619+
605620 DT :: datatable(
606621 data = table_data [[" data" ]],
607622 colnames = table_data [[" col_names" ]],
@@ -619,14 +634,7 @@ listings_server <- function(module_id,
619634 # FIXME: Update to use https://datatables.net/reference/option/layout
620635 dom = " <'top'>rtilp" , # Buttons, filtering, processing display element, table, information summary, length, pagination
621636 fixedColumns = list (left = review_col_count ),
622- initComplete = htmlwidgets :: JS(
623- sprintf(
624- " function(settings, json) {
625- dv_listings.render_bulk_menu(settings.sTableId + \" _wrapper\" , [%s], '%s');
626- }" , paste(paste0(" '" , review [[" choices" ]], " '" ), collapse = " , " ),
627- ns(REV $ ID $ REVIEW_SELECT )
628- )
629- ),
637+ initComplete = htmlwidgets :: JS(bulk_render ),
630638 drawCallback = htmlwidgets :: JS("
631639 function (settings) {
632640 $(settings.nTableWrapper).find('thead input[type=\" search\" ]').removeAttr('disabled');
0 commit comments