Set Deactive Data Row color to red


Go to protected/views/city(whatever your view folder)/admin.php add below highligheted code.

And Create Class with “red”

.red {
background-color:#F8CFCC !important;
}


$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'city-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'rowCssClassExpression' => '
( $row%2 ? $this->rowCssClass[1] : $this->rowCssClass[0] ) .
( $data->is_active==0 ? null : " red" )'
,
'columns'=>array(
'city_name',
array( 'name'=>'name', 'value'=>'$data->state->name' ),
array( 'name'=>'c_name', 'value'=>'$data->country->c_name' ),

array(
'name' =>'is_active',
'value'=> '$data->is_active == 0 ? "Active":"Deactive"'
),

array(
'class'=>'CButtonColumn'
),
),
))

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s