Good evening.
I’ve got a CGridView with 2 columns (column 1 is a foreign key).
I want when I click column 1, the CGridView is sorted by column 1 and then by column 2.
My model:
public function search()
{
.....
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'sort'=>array(
'defaultOrder'=>'FK.A, B ASC',
'attributes'=>array(
'FK'=>array(
'asc'=>'FK.A',
'desc'=>'FK.A DESC',
),
'B'=>array(
'asc'=>'B',
'desc'=>'BDESC',
),
),
),
));
.....
}
DefaultOrder is OK, but not click column order.
Any idea?
Thanks.