-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[docs][data grid] Audit and revise the Pro column docs #17844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mapache-salvaje
merged 30 commits into
mui:master
from
mapache-salvaje:column-ordering-pinning
Jun 6, 2025
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a4f1dcb
initializing
mapache-salvaje 78d9217
ordering first pass
mapache-salvaje e4ef2fb
ordering page title
mapache-salvaje 92d578e
column
mapache-salvaje 1af1603
up to checkbox selection
mapache-salvaje 48f2b9f
first full pass
mapache-salvaje 24f2d15
broken link
mapache-salvaje cf9ed47
Merge branch 'master' into column-ordering-pinning
mapache-salvaje 61cc196
link check
mapache-salvaje 677f8a0
nav title
mapache-salvaje fd55bfb
rearrange ordering page
mapache-salvaje eac1750
parallel structure for disabling sections
mapache-salvaje 17cc90a
parallel copy
mapache-salvaje d56dabf
by default
mapache-salvaje bbf85d0
disabling copy
mapache-salvaje a96a2f3
Merge branch 'master' into column-ordering-pinning
mapache-salvaje f284227
Merge branch 'master' into column-ordering-pinning
mapache-salvaje 50a03ba
cleanup
mapache-salvaje dbc0468
regression
mapache-salvaje 5114bfa
Merge branch 'master' into column-ordering-pinning
mapache-salvaje fe260d5
michel review
mapache-salvaje 447f59d
Merge branch 'master' into column-ordering-pinning
mapache-salvaje 120476b
typo
mapache-salvaje d6f4134
typo typo
mapache-salvaje 728d793
Merge branch 'master' into column-ordering-pinning
mapache-salvaje 959fdce
Apply suggestions from code review
mapache-salvaje 9239c17
remove outdated firefox warning
mapache-salvaje 209df52
Merge branch 'master' into column-ordering-pinning
mapache-salvaje a1e3b97
0e83b98
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,42 @@ | ||
--- | ||
title: Data Grid - Column ordering | ||
title: Data Grid - Drag-and-drop column reordering | ||
--- | ||
|
||
# Data Grid - Column ordering [<span class="plan-pro"></span>](/x/introduction/licensing/#pro-plan 'Pro plan') | ||
# Data Grid - Drag-and-drop column reordering [<span class="plan-pro"></span>](/x/introduction/licensing/#pro-plan 'Pro plan') | ||
|
||
<p class="description">Drag and drop your columns to reorder them.</p> | ||
<p class="description">The Data Grid Pro lets users drag and drop columns to reorder them.</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be more specific about "you" the developer vs "the users" they're developing for |
||
|
||
:::warning | ||
There is [a known issue with Firefox v129](https://github.com/mui/mui-x/issues/14263) that impacts this feature. | ||
Reordering does not work on that specific version of Firefox because the value for `event.dataTransfer` is `null` which results in an error. | ||
Columns are organized according to the order in which they're provided in the `columns` array. | ||
By default, the Data Grid Pro lets users reorder columns by dragging and dropping the header cells—give it a try in the demo below: | ||
|
||
You must upgrade to Firefox v130 or higher to avoid this issue. | ||
::: | ||
{{"demo": "ColumnOrderingGrid.js", "bg": "inline"}} | ||
|
||
By default, columns are ordered according to the order they are included in the `columns` array. | ||
## Column reordering events | ||
|
||
By default, Data Grid Pro allows all column reordering by dragging the header cells and moving them left or right. | ||
Column reordering emits the following events: | ||
|
||
{{"demo": "ColumnOrderingGrid.js", "bg": "inline"}} | ||
- `columnHeaderDragStart`: emitted when the user starts dragging the header cell. | ||
- `columnHeaderDragEnter`: emitted when the cursor enters another header cell while dragging. | ||
- `columnHeaderDragOver`: emitted when the user drags a header cell over another header cell. | ||
- `columnHeaderDragEnd`: emitted when the user stops dragging the header cell. | ||
|
||
To disable reordering on all columns, set the prop `disableColumnReorder={true}`. | ||
## Disabling column reordering | ||
|
||
To disable reordering in a specific column, set the `disableReorder` property to true in the `GridColDef` of the respective column. | ||
Drag-and-drop column reordering is enabled by default on the Data Grid Pro, but you can disable it for some or all columns. | ||
|
||
{{"demo": "ColumnOrderingDisabledGrid.js", "bg": "inline"}} | ||
### For all columns | ||
|
||
In addition, column reordering emits the following events that can be imported: | ||
To disable reordering for all columns, set the `disableColumnReorder` prop to `true`: | ||
|
||
- `columnHeaderDragStart`: emitted when dragging of a header cell starts. | ||
- `columnHeaderDragEnter`: emitted when the cursor enters another header cell while dragging. | ||
- `columnHeaderDragOver`: emitted when dragging a header cell over another header cell. | ||
- `columnHeaderDragEnd`: emitted when dragging of a header cell stops. | ||
```tsx | ||
<DataGridPro disableColumnReorder /> | ||
``` | ||
|
||
### For specific columns | ||
|
||
To disable reordering for a specific column, set the `disableReorder` property to `true` in the column's `GridColDef`, as shown below: | ||
|
||
{{"demo": "ColumnOrderingDisabledGrid.js", "bg": "inline"}} | ||
|
||
## API | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name "Column ordering" doesn't really tell me what this page is about, which is the drag-and-drop reordering feature. I wouldn't necessarily think to look here for this information.