setup_datatable_observers
Sets up reactive observers for a DataTable component to handle user interactions
and state changes. This function establishes the necessary event handlers for
selection changes and synchronizes the component with the shared application state.
setup_datatable_observers(
component_id,
session,
components,
shared_state,
on_selection_change,
registry = NULL
)
NULL. This function is called for its side effects of setting up observers.
Character string. Unique identifier for the DataTable component.
'shiny' session object. The current 'shiny' session for reactive context.
List. Collection of UI components in the application.
Reactive values object. Shared state container for cross-component communication.
Function. Callback function to execute when table selection changes.
List or NULL. Optional registry for component management. Defaults to NULL.
This function creates reactive observers that monitor DataTable interactions and update the shared state accordingly. It handles selection events and ensures proper synchronization between the DataTable component and other application components.