Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix outdated description of GridRowParams.getValue #1731

Merged
merged 3 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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