I need to add a LinkColumn to the GridView used to display the results of the searches. The code generated by gii is the following:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'obra-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'idObra',
'idPintor',
'idEstilo',
'nombreObra',
'fechaObra',
'anchoObra',
array(
'class'=>'CButtonColumn',
),
),
));
I started to modify this code but I don’t know how to get the file name that is composed by two fields of the item showed in the same record of the gridview.
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'obra-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'class'=>'CLinkColumn',
'imageUrl'=>'uploads/thumbnails/'.[[[FILE NAME HERE]]],
'url'=>'uploads/thumbnails/'. [[[FILE NAME HERE]]],
),
'idObra',
'idPintor',
'idEstilo',
'nombreObra',
'fechaObra',
'anchoObra',
array(
'class'=>'CButtonColumn',
),
),
));
Finally I have another question: What I should do in order to show only one o two of the buttons that appear in the ButtonColumn?