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

Applying background colour to entire data table row #119

Open
HDShabe opened this issue Feb 24, 2022 · 2 comments
Open

Applying background colour to entire data table row #119

HDShabe opened this issue Feb 24, 2022 · 2 comments

Comments

@HDShabe
Copy link

HDShabe commented Feb 24, 2022

Development Relevant Information:

BalmUI version: 9.42.1
Browser: Chrome
Operating System: Windows 10

Is there a way to programmatically apply a background colour to all cells within a row? I've got a use case where I've got a button as the final column cell on a row and when clicking it, want to apply a background colour to the entire row.

Playing around with the css in browser I can apply background colours to cells but not to rows, as you'd expect.

Looking at the documentation I can't see any way to apply a class against the row data that would allow me to do this either.

Any ideas apart from writing some javascript that gets the closest and applies a background colour class to all the within, then moving this if another row button is clicked?

Cheers.

@elf-mouse
Copy link
Member

Hi @HDShabe , do you mean that manual operation similar to the selected effect (mdc-data-table__row--selected for <tr>) of documentation demo2?

@HDShabe
Copy link
Author

HDShabe commented Mar 7, 2022

Hi @elf-mouse

Yeah that's correct, apply that background colour to the row programmatically when a control is clicked on the row in my table. Essentially what you have in that documentation demo but I don't want the left hand checkbox / column.

Does that help? Is this possible?

Cheers

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

2 participants