Open sachy123 opened 10 years ago
you can use listData function
TbHtml::listData(Category::model()->findAll(),'id','name')
Hi Guys, Love work done here.
One question couldn't find a way to crate a dropDownListGroup passing an empty value as a default as we do with regular Yii form
$form->dropDownList($model, 'id', CHtml::listData($model->findAll(), 'id', 'username'),array('empty' => '--'));
Is there any way to do that with dropDownListGroup ?
Thanks in advance.
MaximilianoRicoTabo:
'htmlOptions' => array('empty'=>''),
or
'htmlOptions' => array('prompt'=>'')
Will try. Thank you very much ! El mar 9, 2015 9:02 PM, "cgonza85" notifications@github.com escribió:
MaximilianoRicoTabo: 'htmlOptions' => array('empty'=>''), or
'htmlOptions' => array('prompt'=>'')
— Reply to this email directly or view it on GitHub https://github.com/clevertech/YiiBooster/issues/932#issuecomment-77970813 .
Hi Guys, I know that dropDownListGroup can display values as follows
How can I get the values in the 'data' from a database table?