On Fri, Jul 22, 2011 at 11:22 AM, Kaiuwe <dr.kai...@googlemail.com> wrote:

> Am 22.07.2011, 17:06 Uhr, schrieb David Mintz <da...@davidmintz.org>:
>
>
>  I noticed that $helper is a public property of Zend_Form_Element_Select,
>> so
>> rather than extending it, I have started working on a custom view helper
>> instead, whose method signature is the same as that of formSelect in
>> Zend_View_Helper_FormSelect.
>>
>> But the $options array that I am going to pass the
>> Zend_Form_Element_Select
>> constructor won't be like array( 1=> apple, 2 => spinach ), but rather
>> array( array(value=>1,label=>spinach, class=>vegetable ), ... )
>>
>> Any thoughts about this approach? I know that it's kind of crude to
>> deliberately abuse Zend_Form_Element_Select's constructor and then give it
>> a
>> custom view helper to make up for it, but it looks like it's gonna work.
>>
>
>
> Use CSS:
>
> option[label='Foo'] {
>    background-color: red;
> }
>
> option[label='Bar'] {
>    background-color: yellow;
> }
>
> Or look at the issue tracker: http://framework.zend.com/**
> issues/browse/ZF-3580 <http://framework.zend.com/issues/browse/ZF-3580>
>
>

Actually  I'm not concerned about CSS presentation at all. The 'class'
attribute would be strictly semantic, and make it easier to know how to
handle certain 'change' events with jQuery.

The proposal in the issue tracker, if I understand it correctly, presumes
you want all your options to have the same class -- which is less than
trivial to do in js. In my case... well I already explained it earlier.

-- 
David Mintz
http://davidmintz.org/
It ain't over:
http://www.healthcare-now.org/

Reply via email to