ZF-3580: add CLASS= html attribute for Zend/View/Helper/FormSelect.php, like: <option class="dojoDndItem" label="toto" value="toto">
Description
Some javascript frameworks use arbitrary tags, for example Dojo can use class="dojoDndItem" to make some <OPTIONS drag and dropable.
The protected function _build($value, $label, $selected, $disable) into Zend/View/Helper/FormSelect.php lacks of optionnal CLASS= html attrib. for each OPTION. what about a new function _build($value, $label, $selected, $disable, $optionalsAttribs= null) ? with $optionalsAttribs an associative array like ;
$optionalsAttribs= array( 'class' => 'dojoDndItem', 'dndType'=> 'foo'); ... renders:
It can be done programmatically in js.
Comments
Posted by Wil Sinclair (wil) on 2008-07-04T12:38:02.000+0000
It's all you. :)
Posted by Martin (lolek19) on 2011-04-02T22:19:32.000+0000
My fix: [http://paste.jabbim.cz/5186] Example with red background: $combobox = new Zend_Form_Element_Select('list'); $combobox->addMultiOption('value', 'visibleText', array('style'=>'background-color: #FF0000;'));
Posted by Jérémy Huet (jhuet) on 2011-09-15T15:25:20.000+0000
Martin, your paste link is dead, could you share your code again please ? Thanks.