-
-
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.
[data grid] Adds a recipe for using non-native select in filter panel (…
- Loading branch information
1 parent
289ed7a
commit fe5198c
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
docs/data/data-grid/filtering-recipes/UseNonNativeSelect.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,26 @@ | ||
import * as React from 'react'; | ||
import { DataGrid } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
|
||
const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin']; | ||
|
||
export default function UseNonNativeSelect() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Employee', | ||
visibleFields: VISIBLE_FIELDS, | ||
rowLength: 100, | ||
}); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
slotProps={{ | ||
baseSelect: { | ||
native: false, | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
docs/data/data-grid/filtering-recipes/UseNonNativeSelect.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,26 @@ | ||
import * as React from 'react'; | ||
import { DataGrid } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
|
||
const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin']; | ||
|
||
export default function UseNonNativeSelect() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Employee', | ||
visibleFields: VISIBLE_FIELDS, | ||
rowLength: 100, | ||
}); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
slotProps={{ | ||
baseSelect: { | ||
native: false, | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
docs/data/data-grid/filtering-recipes/UseNonNativeSelect.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,8 @@ | ||
<DataGrid | ||
{...data} | ||
slotProps={{ | ||
baseSelect: { | ||
native: false, | ||
}, | ||
}} | ||
/> |
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