dudapiotr / ZfTable

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.
http://dudapiotrek.laohost.net/
MIT License
75 stars 59 forks source link

Row decorators with conditions #50

Open rodrigo-martinez opened 9 years ago

rodrigo-martinez commented 9 years ago

The renderer of rows is not validating the conditions before calling the decorator. As in the rendered of Cells, an if is needed who ask for the validConditions before calling the decorator.

Beside this, when added a ClassDecorator with conditions, the decorator adds the new class to the class attribute of row, so after that the class is added for every next rows. I don't know the best way to fix this, in the code, I added at the begining of the foreach an assigment to reset the class value.

rodrigo-martinez commented 9 years ago

I found the addVarClass that is cleaned after each row rendered. So changing de ClassDecorator instead of using de addClass use the addVarClass

fzipi commented 9 years ago

This change seems useful, could it be merged?