Skip to content

Commit

Permalink
[DataGrid] Add new editing API (#3963)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw authored Mar 15, 2022
1 parent 66490b2 commit 140f394
Show file tree
Hide file tree
Showing 52 changed files with 4,028 additions and 267 deletions.
8 changes: 4 additions & 4 deletions docs/data/data-grid/events/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
{
"name": "cellEditStart",
"description": "Fired when the cell turns to edit mode.",
"params": "GridCellParams",
"params": "GridCellEditStartParams",
"event": "MuiEvent<React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>>"
},
{
"name": "cellEditStop",
"description": "Fired when the cell turns back to view mode.",
"params": "GridCellParams",
"params": "GridCellEditStopParams",
"event": "MuiEvent<MuiBaseEvent>"
},
{
Expand Down Expand Up @@ -200,13 +200,13 @@
{
"name": "rowEditStart",
"description": "Fired when the row turns to edit mode.",
"params": "GridRowParams",
"params": "GridRowEditStartParams",
"event": "MuiEvent<React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>>"
},
{
"name": "rowEditStop",
"description": "Fired when the row turns back to view mode.",
"params": "GridRowParams",
"params": "GridRowEditStopParams",
"event": "MuiEvent<MuiBaseEvent>"
},
{
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/api-docs/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"experimentalFeatures": {
"type": {
"name": "shape",
"description": "{ preventCommitWhileValidating?: bool, rowGrouping?: bool, warnIfFocusStateIsNotSynced?: bool }"
"description": "{ newEditingApi?: bool, preventCommitWhileValidating?: bool, rowGrouping?: bool, warnIfFocusStateIsNotSynced?: bool }"
}
},
"filterMode": {
Expand Down Expand Up @@ -170,6 +170,7 @@
"description": "{ left?: Array&lt;string&gt;, right?: Array&lt;string&gt; }"
}
},
"processRowUpdate": { "type": { "name": "func" } },
"rowBuffer": { "type": { "name": "number" }, "default": "3" },
"rowCount": { "type": { "name": "number" } },
"rowGroupingColumnMode": {
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/api-docs/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"experimentalFeatures": {
"type": {
"name": "shape",
"description": "{ preventCommitWhileValidating?: bool, warnIfFocusStateIsNotSynced?: bool }"
"description": "{ newEditingApi?: bool, preventCommitWhileValidating?: bool, warnIfFocusStateIsNotSynced?: bool }"
}
},
"filterMode": {
Expand Down Expand Up @@ -128,6 +128,7 @@
"type": { "name": "enum", "description": "'client'<br>&#124;&nbsp;'server'" },
"default": "\"client\""
},
"processRowUpdate": { "type": { "name": "func" } },
"rowBuffer": { "type": { "name": "number" }, "default": "3" },
"rowCount": { "type": { "name": "number" } },
"rowHeight": { "type": { "name": "number" }, "default": "52" },
Expand Down
202 changes: 103 additions & 99 deletions docs/pages/api-docs/data-grid/grid-api.md

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions docs/pages/api-docs/data-grid/grid-editing-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"properties": [
{
"name": "commitCellChange",
"description": "Updates the field at the given id with the value stored in the edit row model.",
"description": "Updates the field corresponding to the given id with the value stored in the edit row model.",
"type": "(params: GridCommitCellChangeParams, event?: MuiBaseEvent) => boolean | Promise<boolean>"
},
{
"name": "commitRowChange",
"description": "Updates the row at the given id with the values stored in the edit row model.",
"description": "Updates the row corresponding to the given id with the values stored in the edit row model.",
"type": "(id: GridRowId, event?: MuiBaseEvent) => boolean | Promise<boolean>"
},
{
Expand Down Expand Up @@ -51,6 +51,26 @@
"name": "setRowMode",
"description": "Sets the mode of a row.",
"type": "(id: GridRowId, mode: GridRowMode) => void"
},
{
"name": "startCellEditMode",
"description": "Puts the cell corresponding to the given row id and field into edit mode.",
"type": "(params: GridStartCellEditModeParams) => void"
},
{
"name": "startRowEditMode",
"description": "Puts the row corresponding to the given id into edit mode.",
"type": "(params: GridStartRowEditModeParams) => void"
},
{
"name": "stopCellEditMode",
"description": "Puts the cell corresponding to the given row id and field into view mode and updates the original row with the new value stored.\nIf <code>params.ignoreModifications</code> is <code>false</code> it will discard the modifications made.",
"type": "(params: GridStopCellEditModeParams) => Promise<boolean>"
},
{
"name": "stopRowEditMode",
"description": "Puts the row corresponding to the given id and into view mode and updates the original row with the new values stored.\nIf <code>params.ignoreModifications</code> is <code>false</code> it will discard the modifications made.",
"type": "(params: GridStopRowEditModeParams) => Promise<boolean>"
}
]
}
3 changes: 2 additions & 1 deletion docs/pages/x/api/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"experimentalFeatures": {
"type": {
"name": "shape",
"description": "{ preventCommitWhileValidating?: bool, rowGrouping?: bool, warnIfFocusStateIsNotSynced?: bool }"
"description": "{ newEditingApi?: bool, preventCommitWhileValidating?: bool, rowGrouping?: bool, warnIfFocusStateIsNotSynced?: bool }"
}
},
"filterMode": {
Expand Down Expand Up @@ -170,6 +170,7 @@
"description": "{ left?: Array&lt;string&gt;, right?: Array&lt;string&gt; }"
}
},
"processRowUpdate": { "type": { "name": "func" } },
"rowBuffer": { "type": { "name": "number" }, "default": "3" },
"rowCount": { "type": { "name": "number" } },
"rowGroupingColumnMode": {
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/x/api/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"experimentalFeatures": {
"type": {
"name": "shape",
"description": "{ preventCommitWhileValidating?: bool, warnIfFocusStateIsNotSynced?: bool }"
"description": "{ newEditingApi?: bool, preventCommitWhileValidating?: bool, warnIfFocusStateIsNotSynced?: bool }"
}
},
"filterMode": {
Expand Down Expand Up @@ -128,6 +128,7 @@
"type": { "name": "enum", "description": "'client'<br>&#124;&nbsp;'server'" },
"default": "\"client\""
},
"processRowUpdate": { "type": { "name": "func" } },
"rowBuffer": { "type": { "name": "number" }, "default": "3" },
"rowCount": { "type": { "name": "number" } },
"rowHeight": { "type": { "name": "number" }, "default": "52" },
Expand Down
Loading

0 comments on commit 140f394

Please sign in to comment.