Hi,
I have two columns in my datagrid that I’m adding together and displaying in a third column. I can do this but the datagrid won’t let me sort the calculated column. Here’s my code:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
'columns'=>array(
'risk_id',
'description',
/*'objective',*/
'likelihood',
'rank',
array(
'header'=>'Score',
'value'=>'$data->rank + $data->likelihood',
'name'=>'$data->rank + $data->likelihood',
'sortable'=>true,
),
I’m sure that I’m doing something wrong with the ‘Name’ property of the DataColumn but I can’t work out where the problem is.