Hi guys
Just wondering if anyone has any ideas about this.
I have a dropdown menu filled with data from the database.
It contains a list of course application statuses which I would like to group using optGroup.
For example, the applicant status can have multiple application status e.g.,
Admitted => ‘Application Approved’, ‘Payment Received’, ‘Confirmation Sent’
Rejected => ‘Application Rejected’, ‘Unpaid Invoice’ etc etc
I have the following which is working, but the problem is that 'applicant_status is a relation and I’m only getting the id rather the name.
Here is the dropdown code:
// The list should be sorted using applicant_status as an optGroup
CHtml::activeDropDownList($data, 'status',
CHtml::listData(Status::model()->findAll(array(
'order'=>'status_name')),'status_id', 'status_name', 'applicant_status'));
and the relation
'appStatus' => array(self::BELONGS_TO, 'ApplicantStatus', array(
'applicant_status'=>'applicant_status_id'), 'through'=>'status'),
This works but I am getting applicant_status_id rather than applicant_status_name.
Any ideas would be most appreciated!