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
canDragAndDropColumns functionality stems from a feature request: #7136. It has been introduced on #8015. It's in beta status to assure that the functionality works as expected, that the implementation is stable and doesn't cause conflicts with existing usages. The purpose of this task is to track, analyze the usage and stability of, and plan moving the functionality out of beta.
Feature description
canDragAndDropColumns is a boolean prop of the EuiDataGrid component. It enables reordering the columns by dragging.
canDragAndDropColumns is set to true by default. So unless it's explicitly disabled, the functionality exists in all usages of the EuiDataGrid component.
x-pack/platform/plugins/shared/streams_app/public/components/data_management/preview_table/index.tsx (set to false)
x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx (set to false)
Discover
tl;dr; In the default view, columns cannot be reordered. In a custom view (after applying a filter), columns can be reordered.
The DataTable component is located at src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx, which accepts a prop called canDragAndDropColumns. This prop is passed from src/platform/plugins/shared/discover/public/components/discover_grid/discover_grid.tsx and is always set to true when used within the Discover plugin.
This prop is internal to Discover implementation and, at this stage, it does not relate to the EuiDataGrid.
Inside data_table.tsx, where the data grid is used, we check whether we have the default column layout, which includes fields like "timestamp" and "summary" (the default Kibana view). When you load Kibana with the default settings, this layout is used.
canDragAndDropColumns
functionality stems from a feature request: #7136. It has been introduced on #8015. It's in beta status to assure that the functionality works as expected, that the implementation is stable and doesn't cause conflicts with existing usages. The purpose of this task is to track, analyze the usage and stability of, and plan moving the functionality out of beta.Feature description
canDragAndDropColumns
is a boolean prop of theEuiDataGrid
component. It enables reordering the columns by dragging.Screen.Recording.2025-03-06.at.10.44.50.mov
Storybook
Usage notes
canDragAndDropColumns
is set totrue
by default. So unless it's explicitly disabled, the functionality exists in all usages of theEuiDataGrid
component.EuiDataGrid usages:
canDragAndDropColumns
usages:src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx
src/platform/plugins/shared/discover/public/components/discover_grid/discover_grid.tsx
x-pack/platform/plugins/shared/streams_app/public/components/data_management/preview_table/index.tsx
(set tofalse
)x-pack/platform/plugins/shared/streams_app/public/components/data_management/schema_editor/schema_editor_table.tsx
(set tofalse
)Discover
tl;dr; In the default view, columns cannot be reordered. In a custom view (after applying a filter), columns can be reordered.
The
DataTable
component is located atsrc/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx
, which accepts a prop calledcanDragAndDropColumns
. This prop is passed fromsrc/platform/plugins/shared/discover/public/components/discover_grid/discover_grid.tsx
and is always set totrue
when used within the Discover plugin.This prop is internal to Discover implementation and, at this stage, it does not relate to the
EuiDataGrid
.Inside
data_table.tsx
, where the data grid is used, we check whether we have the default column layout, which includes fields like "timestamp" and "summary" (the default Kibana view). When you load Kibana with the default settings, this layout is used.If the layout is the default one, we send
false
for thecanDragAndDropColumns
prop, meaning that the columns cannot be reordered.However, if a filter is added from the left side, we pass
canDragAndDropColumns
with a value oftrue
(because parent sets the prop astrue
always).Goal
As part of this ticket, we should test out usage and developer experience, and plan accordingly for improvements.
The text was updated successfully, but these errors were encountered: