react-grid-table icon indicating copy to clipboard operation
react-grid-table copied to clipboard

Column props with access to rowData

Open stychu opened this issue 3 years ago • 0 comments

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 ?

stychu avatar Dec 08 '22 11:12 stychu