CLinkColumn and filter
I am using YII framework. I will make an email link on my list from GRID. I added:
array(
'class'=>'CLinkColumn',
'header'=>'e-mail',
'labelExpression'=>'$data->email',
'urlExpression'=>'"mailto:".$data->email',
),
this works fine, but now i am not filtering the hava column. CLinkColumns has no method filter. How can I make a mailto: link and use a filter for that?
source to share
You cannot use a filter with CLinkColumn.
Yii developers discussed the addition 'name'
in CLinkColumn
here: https://github.com/yiisoft/yii/pull/970
They decided against:
... there is no need to "complicate" [CLinkColumn] further as it will simply be duplicate code or hacks to solve problems ...
samdark says:
CLinkColumn will be available for simple use only. If you need more options, consider using a value.
This is their recommended alternative:
array(
'name' => 'field_name',
'type' => 'raw',
'value' => 'CHtml::link($data->field_name,$data->field_name)'
),
source to share