giving to the listdata method the parameter to group items in a activeDropDownList return an exception Invalid argument supplied for foreach() at line 886 of CHtml file.
rel 100.
Page 1 of 1
grouping dropdownlist
#3
Posted 21 October 2008 - 11:01 AM
<?php echo CHtml::activeDropDownList($job_orders,'jbr_customer',
CHtml::listData(CActiveRecord::model(customers)->findAll(),
cst_pk,cst_description,cst_number),
array('prompt'=>'seleziona')); ?>
where customers is a table with cst_pk as primary key, and cst_description and cst_number as fields. as you can see i'm trying to group by cst_number
#4
Posted 21 October 2008 - 01:07 PM
From the code, I can't see any problem. Could you print_r(CHtml::listData(...))? Line 886 is complaining that the list data is not an array.
What is cst_pk, cst_description? are they string or constant?
It is also recommended that you use customers::model() instead of CActiveRecord::model(customers).
What is cst_pk, cst_description? are they string or constant?
It is also recommended that you use customers::model() instead of CActiveRecord::model(customers).
Share this topic:
Page 1 of 1