-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XGrid] Add ability to disable reorder on some columns (#2085)
* [DataGrid] Add ability to disable reorder on some columns * Write tests * Run prettier * Fix * Fix * Add doc * Code review * Code review * Fix * Build doc * Fix * Fix * Code review
- Loading branch information
1 parent
ee36b05
commit 7e93d3f
Showing
11 changed files
with
290 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
docs/src/pages/components/data-grid/columns/ColumnOrderingDisabledGrid.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as React from 'react'; | ||
import { XGrid } from '@material-ui/x-grid'; | ||
|
||
const rows = [ | ||
{ | ||
id: 1, | ||
username: '@MaterialUI', | ||
age: 20, | ||
}, | ||
]; | ||
|
||
export default function ColumnOrderingDisabledGrid() { | ||
return ( | ||
<div style={{ height: 250, width: '100%' }}> | ||
<XGrid | ||
columns={[ | ||
{ field: 'id' }, | ||
{ field: 'username' }, | ||
{ field: 'age', disableReorder: true }, | ||
]} | ||
rows={rows} | ||
/> | ||
</div> | ||
); | ||
} |
25 changes: 25 additions & 0 deletions
25
docs/src/pages/components/data-grid/columns/ColumnOrderingDisabledGrid.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as React from 'react'; | ||
import { XGrid } from '@material-ui/x-grid'; | ||
|
||
const rows = [ | ||
{ | ||
id: 1, | ||
username: '@MaterialUI', | ||
age: 20, | ||
}, | ||
]; | ||
|
||
export default function ColumnOrderingDisabledGrid() { | ||
return ( | ||
<div style={{ height: 250, width: '100%' }}> | ||
<XGrid | ||
columns={[ | ||
{ field: 'id' }, | ||
{ field: 'username' }, | ||
{ field: 'age', disableReorder: true }, | ||
]} | ||
rows={rows} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains 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 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 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 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 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 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
Oops, something went wrong.