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.
canDragAndDropColumnsfunctionality 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
canDragAndDropColumnsis a boolean prop of theEuiDataGridcomponent. It enables reordering the columns by dragging.Screen.Recording.2025-03-06.at.10.44.50.mov
Storybook
Usage notes
canDragAndDropColumnsis set totrueby default. So unless it's explicitly disabled, the functionality exists in all usages of theEuiDataGridcomponent.EuiDataGrid usages:
canDragAndDropColumnsusages:src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsxsrc/platform/plugins/shared/discover/public/components/discover_grid/discover_grid.tsxx-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
DataTablecomponent 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.tsxand is always set totruewhen 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
falsefor thecanDragAndDropColumnsprop, meaning that the columns cannot be reordered.However, if a filter is added from the left side, we pass
canDragAndDropColumnswith a value oftrue(because parent sets the prop astruealways).Goal
As part of this ticket, we should test out usage and developer experience, and plan accordingly for improvements.