I do not know about the cycle view helper, but if you keep the count of the row, you can get ($count % 2 === 0) to get the alternating and you can just call out your decorator from the row and set the class attrib to whatever you need.
However, if your row is a TR, setting a class for the background color might not help? I'm not sure about that. I know border properties do not have any effect on tr, they have to be set on each td.

But assuming your row is a div, with a decorator called HtmlTag, do something like:
$form->getElement('firstIdOnMyRow')->getDecorator('HtmlTag')->setAttrib('class', 'alternateColor');

Not sure if it is setAttrib or setOption, but I'm sure you will find out.

Regards,

Bart

Colin Guthrie schreef:
DorkFest wrote:
Anyone have any simple strategies for providing alternative row CSS classes
(eg: "odd-row", "even-row") in a Zend_Form?

I think the cycle view helper is used, but not sure how that fits in a zend form.


http://framework.zend.com/wiki/display/ZFPROP/Zend_View_Helper_Cycle+-+Kamil+Nowakowski

I've not learned enough zend_form foo yet to know if/how the view helpers can be used in a zend form decorator.

Col


--
Bart McLeod
Space Web Internet Team
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ [EMAIL PROTECTED]
www.spaceweb.nl
zce logo zce PHP 5 logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!

Reply via email to