US-1234
US-1234

Reputation: 1529

Validating column null values in Yii Framework

I am trying to validate null values in a column and i have to update another column based on this validation. My request is,

  1. Say i have Column 'Type' , if column 'Type' has some value in DB means i have to display tick mark in "Valid" column in CGridView. (Valid column is psuedo column)

  2. Column 'Type' has null values means i have to display untick mark in "valid" column.

Please provide any idea over this.

enter image description here

Upvotes: 0

Views: 384

Answers (1)

naveen goyal
naveen goyal

Reputation: 4629

Add New Column in Gridview with

array('name' => 'Status',
            'value' => '!empty($data->type) ? "<img />" : "<img tag/>"',
            'type' => 'raw'),

you can put your image tag with src in this.

Upvotes: 1

Related Questions