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

Column props with access to rowData #112

Open
stychu opened this issue Dec 8, 2022 · 0 comments
Open

Column props with access to rowData #112

stychu opened this issue Dec 8, 2022 · 0 comments

Comments

@stychu
Copy link

stychu commented Dec 8, 2022

Would it be possible to change some of the column configuration properties from primitive value types to function types with access to the rowData??

https://github.com/NadavShaar/react-grid-table#columns

Im especially interested in the editable property for the column.
Having it as a boolean type makes it as fixed global configuration. If it could be defined as the getValue for example It could be set dynamically based on the row.

editable: ({rowData,column}) => boolean

This way I could have some rows that could have all required columns to be editable and some rows that can have mixed columns to be only editable and rest of them not editable. I can achieve this via editorCellRenderer checking inside it if the given data property allows the cell to be editable but I believe editable property on configuration would be more accurate for this and reduce code complexity of editorCellRenderer component

This could be considered for other column configuration properties too I believe.

Would this be possible to do ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant