сделал казалось бы по мануалу но что-то сортировки по реляционному полю не происходит - скажем чтобы сортировать менеджеров по названию отдела. в модели
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'roleinfo' => array(self::BELONGS_TO, 'Role', 'mrole'),
'rmstructure' => array(self::BELONGS_TO, 'Structure', 'mstructure'),
);
}
в контроллере
public function managerProvider()
{
return new CActiveDataProvider('Manager', array(
'criteria'=>array(
'with'=>array('rmstructure'),
),
'sort'=>array(
'attributes'=>array(
'mfamily'=>array('default' => 'desc'),
'mhat'=>array('default' => 'desc'),
'rmstructure.sr_name'=>array(
'default' => 'desc'
),
),
),
'pagination'=>array(
'pageSize'=>3,
),
));
}
и вью
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$managerList,
'id'=>'gowner-grid',
'cssFile'=>'/css/nv_grid.css',
'columns'=>array(
array(
'value'=>'CHtml::radioButton("manager", $data->mid==$model->gowner ? true : false, array("value"=>$data->mid))',
'type'=>'raw',
),
'mfamily',
'mhat',
'rmstructure.sr_name',
),
));
если кто видит что я тут напутал - подскажите.