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] Improve GridApi descriptions #1767

Merged
merged 5 commits into from
May 26, 2021

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented May 25, 2021

Breaking changes

  • [XGrid] The getEditCellValueParams method was removed from the apiRef ([docs] Improve GridApi descriptions #1767) @m4theushw

    The method was almost a straightforward alias of getEditCellPropsParams.

    -const { value } = apiRef.current.getEditCellValueParams(id, field);
    +const { props: { value } } = apiRef.current.getEditCellPropsParams(id, field);

Fixes #1705

Also adds missing prefixes, like #1705 (comment).

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label May 25, 2021
packages/grid/_modules_/grid/models/api/gridEditRowApi.ts Outdated Show resolved Hide resolved
*/
getEditCellValueParams: (rowId: GridRowId, field: string) => GridEditCellValueParams;
/**
* Commit the cell value changes to update the cell value.
* @param update
* @ignore - do not document
*/
commitCellChange: (params: GridEditCellPropsParams) => void;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a rationale to expose this method in the API. Although used in this demo, the same thing can be done with apiRef.current.setCellValue.

Copy link
Member

@oliviertassinari oliviertassinari May 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4theushw From what I understand of the initial terminology: "commit" value means that the value is stored and will be taken part of the ctrl + z, ctrl + alt + z history feature. "set" value means that the value is only locally updated without updating the underlying rows. I would personally do the opposite, kill setCellValue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there would be a history feature then makes sense to have the "commit". I added the ignore to setCellValue for now.

@oliviertassinari oliviertassinari removed their request for review May 25, 2021 21:09
@m4theushw m4theushw merged commit e53c058 into mui:master May 26, 2021
@m4theushw m4theushw deleted the update-api-descriptions branch May 26, 2021 16:08
@oliviertassinari oliviertassinari changed the title [docs] Update GridApi descriptions [docs] Improve GridApi descriptions May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] The description of apiRef is grammatically incorrect
3 participants