-
-
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.
[docs] Add section explaining how to keep the selection while filteri…
…ng (#15185) Signed-off-by: Armin Mehinovic <[email protected]> Co-authored-by: Sycamore <[email protected]>
- Loading branch information
1 parent
b204906
commit c75774c
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/data/data-grid/row-selection/KeepNonExistentRowsSelected.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,30 @@ | ||
import * as React from 'react'; | ||
import { DataGrid, GridToolbar } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
|
||
export default function KeepNonExistentRowsSelected() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 10, | ||
maxColumns: 6, | ||
}); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
checkboxSelection | ||
disableRowSelectionOnClick | ||
keepNonExistentRowsSelected | ||
slots={{ | ||
toolbar: GridToolbar, | ||
}} | ||
slotProps={{ | ||
toolbar: { | ||
showQuickFilter: true, | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
docs/data/data-grid/row-selection/KeepNonExistentRowsSelected.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,30 @@ | ||
import * as React from 'react'; | ||
import { DataGrid, GridToolbar } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
|
||
export default function KeepNonExistentRowsSelected() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 10, | ||
maxColumns: 6, | ||
}); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
checkboxSelection | ||
disableRowSelectionOnClick | ||
keepNonExistentRowsSelected | ||
slots={{ | ||
toolbar: GridToolbar, | ||
}} | ||
slotProps={{ | ||
toolbar: { | ||
showQuickFilter: true, | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
docs/data/data-grid/row-selection/KeepNonExistentRowsSelected.tsx.preview
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,14 @@ | ||
<DataGrid | ||
{...data} | ||
checkboxSelection | ||
disableRowSelectionOnClick | ||
keepNonExistentRowsSelected | ||
slots={{ | ||
toolbar: GridToolbar, | ||
}} | ||
slotProps={{ | ||
toolbar: { | ||
showQuickFilter: true, | ||
}, | ||
}} | ||
/> |
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