forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[data grid] Add default reset value in row edit mode (mui#14050)
Signed-off-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com>
- Loading branch information
1 parent
9e1bc88
commit 4e0127e
Showing
4 changed files
with
122 additions
and
106 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { GridColDef } from '../../../models/colDef/gridColDef'; | ||
|
||
export const getDefaultCellValue = (colDef: GridColDef) => { | ||
switch (colDef.type) { | ||
case 'boolean': | ||
return false; | ||
case 'date': | ||
case 'dateTime': | ||
case 'number': | ||
return undefined; | ||
case 'singleSelect': | ||
return null; | ||
case 'string': | ||
default: | ||
return ''; | ||
} | ||
}; |
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