开发者

How to customize Zend_Form_Element_Select

How to put space in between option value of Zend_Form_Element_Select Expected result as follows,

http://jsfiddle.net/HLbQE/

Tried as follows,

$this->addElement('Select', 'parent_id', array(
      'label' => 'Select Category',
      'multiOptions' => array('0'=>'Gents','1'=>'  &am开发者_如何学编程p;nbsp;Jeans','2'=>'   Sunglass','3'=>'Ladies','4'=>'   Jeans','5'=>'   Sunglass')
));

but fails,

Any help please


Why not just use optgroups? ZF handles this natively by using a nested array for the multi-options, eg

$options = array(
    'Gents' => array(
        1 => 'Jeans',
        2 => 'Sunglass'
    ),
    'Ladies' => array(
        3 => 'Jeans',
        4 => 'Sunglass'
    )
);

Updated demo here - http://jsfiddle.net/HLbQE/1/


Try this:

$this->addElement('Select', 'parent_id', array(
      'label' => 'Select Category',
      'multiOptions' => array('0'=>'Gents','1'=>'   Jeans','2'=>'   Sunglass','3'=>'Ladies','4'=>'   Jeans','5'=>'   Sunglass'),
      'escape' => false // <-- added 
));

I seems this will not work indeed, as reported in this, still unresolved, issue:
http://framework.zend.com/issues/browse/ZF-5351

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜