Wiki

Articles tagged with "datacolumn", sorted by viewsX
Displaying 1-3 of 3 result(s).

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 2 years ago by c@cbaTutorials3 comments – viewed 36,282 times – ( +27 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

Filter & Sort by calculated/related fields in GridView Yii 2.0

Created 5 months ago by Kartik VTutorials18 comments – viewed 10,542 times – ( +29 / -4 ) – version 2.0
This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.

Filter & Sort by Summary Data in GridView Yii 2.0

Created 2 months ago by Kartik VTutorials5 comments – viewed 2,425 times – ( +24 / -4 ) – version 2.0
This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.