balm-ui icon indicating copy to clipboard operation
balm-ui copied to clipboard

Applying background colour to entire data table row

Open HDShabe opened this issue 2 years ago • 2 comments

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.

HDShabe avatar Feb 24 '22 14:02 HDShabe

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

elf-mouse avatar Mar 02 '22 06:03 elf-mouse

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

HDShabe avatar Mar 07 '22 11:03 HDShabe