Skip to content

Commit

Permalink
[DataGrid] Undefined issue fix (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
visshaljagtap authored May 28, 2021
1 parent 7bc9d3e commit 844058b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docs/src/pages/components/data-grid/columns/columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ To achieve that, set the `valueGetter` attribute of `GridColDef` as in the examp
**Note**: You need to set a `sortComparator` for the column sorting to work when setting the `valueGetter` attribute.

```tsx
function getFullName(params: ValueGetterParams) {
return `${params.getValue('firstName') || ''} ${
params.getValue('lastName') || ''
function getFullName(params) {
return `${params.getValue(params.id, 'firstName') || ''} ${
params.getValue(params.id, 'lastName') || ''
}`;
}

Expand Down
19 changes: 6 additions & 13 deletions docs/src/pages/components/data-grid/style/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ interface GridRowParams {
* The grid row id.
*/
id: GridRowId;
/**
* The HTMLElement row element.
*/
element?: HTMLElement | null;
/**
* A function that let you get data from other columns.
* @param field
*/
getValue: (field: string) => GridCellValue;
/**
* The row model of the row that the current cell belongs to.
*/
Expand All @@ -58,14 +49,16 @@ interface GridRowParams {
* All grid columns.
*/
columns: any;
/**
* The row index of the row that the current cell belongs to.
*/
rowIndex: number;
/**
* GridApiRef that let you manipulate the grid.
*/
api: any;
/**
* Get the cell value of a row and field.
* @param id
* @param field
*/
getValue: (id: GridRowId, field: string) => GridCellValue;
}
```

Expand Down

0 comments on commit 844058b

Please sign in to comment.