I am creating a drop down menu in zend form . I want to increse the width of the menu but it's failing.
Here is the code for my dropdown
$this->addElement('select', 'user_role_id', array(
'decorators' => array(
'ViewHelper'
),
'required' => true,
'label' => 'Role',
'width' =>'930',
'multioptions' => array(开发者_运维问答
'1' => 'Admin',
'2' => 'Manager',
'3' => 'User'
),
));
You can use the class attribute to assign a CSS class or add the width to the elements CSS manually:
AddClass
$user_role_id = $this->addElement('select', 'user_role_id');
$user_role_id->class = 'wide-select';
SetAttribs
$user_role_id = $this->addElement('select', 'user_role_id');
$user_role_id->setAttribs(array('style' => 'width: 930px;'));
精彩评论