-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remove getCellActions prop #1845
Conversation
width: 200 | ||
width: 200, | ||
cellClass: 'rdg-cell-action', | ||
formatter({ row, value }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want we can use the new cellContentRenderer
API here.
cellContentRenderer({ rowData }) {
const value = rowData.county;
if (rowData.id === 'id_0') {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably do not need cellContentRenderer
once subrows functionality is removed. We can also delete CellContent
component and use formatter
as cellContentRenderer
. We can then replace defaultCellContentRenderer
with defaultFormatter
. Wdyt?
We can merge this PR after the lerna removal PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
IMO RDG shouldn't access the value from the row object, so we can have renderers like
({ rowData }) => rowData.nested.value;
({ rowData }) => rowData.x + rowData.y;
for example. And it might simplify types as well, maybe.
Is this |
That is correct. It basically provides a way to add actions to a cell but the same functionality can be achieved with a custom formatter. Check the cell actions example. Also with this change we can use any component for the actions. . |
@amanmahajan7 columns definition is usually done "outside" of the component, same goes for the formatter, which makes it difficult to do anything with an action fired from within the formatter - no way to "communicate" with component. |
A separate
getCellActions
prop is not required and cell actions feature can be easily implemented using a custom formatter.Next we can remove props to implement subrows also