You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { DataView } from '@patternfly/react-data-view/dist/dynamic/DataView';
19
-
import { useDataViewEventsContext, DataViewProvider, EventTypes } from '@patternfly/react-data-view/dist/dynamic/DataViewEventsContext';
19
+
import { DataViewTable } from '@patternfly/react-data-view/dist/dynamic/DataViewTable';
20
+
import { useDataViewEventsContext, DataViewEventsContext, DataViewEventsProvider, EventTypes } from '@patternfly/react-data-view/dist/dynamic/DataViewEventsContext';
20
21
import { Drawer, DrawerContent, DrawerContentBody } from '@patternfly/react-core';
21
22
22
-
The **data view** context provides a way to share data across the entire data view tree without having to pass props manually at every level. It also provides a way of listening to the data view events from the outside of the component.
23
+
The **data view events context** provides a way of listening to the data view events from the outside of the component.
23
24
24
-
25
-
### Events sharing example
25
+
### Row click subscription example
26
26
The following example demonstrates how to use the `DataViewEventsContext` to manage shared state and handle events. The `DataViewEventsProvider` is used to wrap components that need access to the shared context. This example illustrates how to set up a layout that listens for data view row click events and displays detailed information about the selected row in a [drawer component](/components/drawer).
0 commit comments