Table: also pass rowData to rowClassName and rowStyleObject
See original GitHub issueThis already happens for onRowClick
. It would be nice if rowClassName
could also receive the rowData
in its parameters when it’s used as a function.
At first sight it looks like it’s just a matter of moving this line up and passing it to the functions. For the header row it can be left undefined.
I can do a PR if you want.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
CSS for colouring one row of antd table in react - Stack Overflow
I found two ways to do this as of now: One way is to use rowClassName prop of Table: .table-row-light { background-color: #ffffff;...
Read more >react-virtualized | Yarn - Package Manager
This supports special use-cases where deferred measuring is not desired. Added estimatedRowSize property to FlexTable and VirtualScroll to be passed through to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @Janpot
Thanks for the clearly articulated feature request and the offer to submit a PR. (Especially the second one!)
This sort of request comes up fairly often- to support more event types at the row-level or to pass more data to an event handler. At first I added features like this but more recently I’ve started pushing back because I think it has the possibility to cause bloat. (If 99% of users don’t use a feature- and it’s possible to implement in user code- then it probably doesn’t belong in the lib.)
Anyway, this is one such feature that can be implemented in your application code and so I think it’s probably best to stay there.
The same approach could be applied with a class component:
I stand corrected