Skip to contents

How to set up a listings module using dispatchers

Dispatchers are helper functions that allow accessing data and utility functions inside module manager in a dynamic way. Refer to ?dv.manager::mm_dispatch for more information about their functionalities. The boxes below show two examples on how they can be used to set up a listings module. Note that it is not possible to use both arguments, dataset_names and dataset_disp, at the same time in a mod_listings() call.

a. Filtered data

This code chunk produces essentially the same app behavior as using the dataset_names argument. That is, any selection made by the user in the global filter menu affects the module display.

dv.listings::mod_listings(
  module_id = "mod2a",
  dataset_disp = dv.manager::mm_dispatch(
    from = "filtered_dataset",
    selection = c("adsl", "adae", "adtte")
  )
)

b. Unfiltered data

In case it is undesirable that global filter settings affect the listings displayed in a listings module, it is possible to define the dispatcher such that it delivers always unfiltered data. This means that any global filter will be ignored!

dv.listings::mod_listings(
  module_id = "mod2b",
  dataset_disp = dv.manager::mm_dispatch(
    from = "unfiltered_dataset",
    selection = c("adsl", "adae", "adtte")
  )
)