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

Style for all rows in a particular group

Open smtheard opened this issue 9 years ago • 9 comments

Hello, I am looking for a way to style all rows within a particular group. When inspecting the objects I see that idx cannot be used because if your groups are of many different sizes it is unreliable for order. I essentially need a reference to the "group I am in" from the row perspective to determine my background color for my use case. Is there a simple way to do this? If not, consider this a feature request.

Thanks!

WHICH VERSION OF REACT ARE YOU USING?

Officially Supported:
[x ] v0.14.x
Community Supported:
[ ] v15.0.x

WHICH BROWSER ARE YOU USING?

Officially Supported:
[ ] IE 9 / IE 10 / IE 11
[ ] Edge
[x ] Chrome
Should work:
[ ] Firefox
[ ] Safari

I'm submitting a ... (check one with "x")

[ ] bug report
[ x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md

Current behavior No obvious way to reference current group from row renderer

Expected/desired behavior Row renderer should know what group it is in so it can be styled

Reproduction of the problem Attempt to style groups of rows uniquely

What is the motivation / use case for changing the behavior? Instead of providing just a header as a visual signal for what is grouped, I would also like to change the background color of the rows in an alternating-by-group fashion

smtheard avatar Jun 23 '17 21:06 smtheard

I implemented this successfully but it was very hacky, I am using my own counter to construct a group number and indexing it by the name of the GroupRow, and referencing my own group number to do the styling.

smtheard avatar Jun 23 '17 21:06 smtheard

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Jul 12 '18 15:07 stale[bot]

still a legitimate issue, should fix.

smtheard avatar Jul 12 '18 18:07 smtheard

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Aug 11 '18 18:08 stale[bot]

stahp

smtheard avatar Aug 13 '18 19:08 smtheard

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Sep 12 '18 19:09 stale[bot]

still an issue but this bot is terrible

smtheard avatar Sep 12 '18 20:09 smtheard

can you show your solution please?

DrogoNevets avatar May 15 '19 08:05 DrogoNevets

@DrogoNevets

can you show your solution please?

"I am using my own counter to construct a group number and indexing it by the name of the GroupRow, and referencing my own group number to do the styling."

this is all I have from the solution, I no longer have access to the source code written relating to this problem.

smtheard avatar May 16 '19 06:05 smtheard