Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tapestry: set css class of a Grid column

Tags:

css

grid

tapestry

I'd like to specify the css class that the Tapestry Grid component assigns to the TH and TD tags in a column. Is this possible?

like image 347
Ollie Glass Avatar asked Jan 27 '26 05:01

Ollie Glass


1 Answers

And the long answer is yes!

If the class attributes, mentioned in Steve Enyon's answer, are not enough you can decorate the DOM after the grid has rendered via a mixin. I have created a GridDecorator mixin here which can decorate TR and TD elements based on the value in the cell / row. In my example I add onclick and style attributes to the DOM. You could easily tweak the mixin to decorate TH elements with a GridHeaderCellDecorator and add class attributes where necessary.

My 2p, I think that the Grid is long overdue for an overhaul and that customisations like this should be much easier than they are.

like image 75
lance-java Avatar answered Jan 28 '26 20:01

lance-java



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!