Open ohjakobsen opened 3 months ago
For reactable tables, we could add a utility function that defines global definitions for columns that are used in multiple tables. This will reduce complexity in code, increase consistency and keep code more DRY.
reactable
Here is an example of such a utility function:
default_columns <- function(columns, column_definitions = list()) { defaults <- list( client = colDef(name = 'Klient', maxWidth = 100), comp_reg_no = colDef(name = 'Org.nr', maxWidth = 100), voucher_no = colDef(name = 'Bilag') ) column_list <- defaults[columns[columns %in% names(defaults)]] return(modifyList(column_list, column_definitions)) }
_Originally posted by @ohjakobsen in https://github.com/Riksrevisjonen/pioneeR/pull/106#discussion_r1625770392_
For
reactable
tables, we could add a utility function that defines global definitions for columns that are used in multiple tables. This will reduce complexity in code, increase consistency and keep code more DRY.Here is an example of such a utility function:
_Originally posted by @ohjakobsen in https://github.com/Riksrevisjonen/pioneeR/pull/106#discussion_r1625770392_