Difference between #13 and #14 of
CGridView: Render customized/complex datacolumns

Changes

Title unchanged

CGridView: Render customized/complex datacolumns

Category unchanged

Tips

Yii version unchanged

Tags unchanged

CGridView

Content changed

[...]
You can try to render a CListView (default actionIndex of a CRUD controller) into a cell too.

Access column properties
-----------------

In the examples above, I use different methods for each gridcolumn.
 So I didn't have to take care about the column properties.

If you want to use a single method for each column or need more information about the currently rendered column, add a third param (for example $dataColumn) to your called method:
[...]
//controller code
 
class ProductController extends Controller { ... protected function gridProductrenderGridCell($data,$row,$dataColumn)
{
//var_dump($dataColumn);
//$dataColumn is an instance of a [CDataColumn](http://www.yiiframework.com/doc/api/1.1/CDataColumn "CDataColumn")
//you have access to the properties and methods here (name, id, type, value, grid ...)
[...]
53 0
74 followers
Viewed: 168 959 times
Version: 1.1
Category: Tips
Tags: CGridView
Written by: Joblo
Last updated by: Joblo
Created on: Nov 27, 2011
Last updated: 11 years ago
Update Article

Revisions

View all history