I have a email form that contains check boxes that uses checkBoxList to list the data model alphabetically…
$criteria = new CDbCriteria;
$criteria->order = 'name';
echo $form->checkBoxList($model, 'communities', CHtml::listData(Community::model()->findAll($criteria), 'name', 'name'));
A simplified version of the list would look like this…
A
B
C - 1 (The Cs are all separate records but have the same name except for after the dash)
C - 2
C - 3
D
I would like to move B to the bottom of the list and also combine all the Cs into one check box labeled as only C (without the ’ - #’). The list would look like this…
A
C
D
B
I can’t figure out how to do this with checkBoxList. Is there an easy way to do this that I am overlooking?
I hope I have explained this clearly enough.
Thanks in advance for your help!