nullDisplay property in Cgridview
The text to be displayed in a data cell when a data value is null. This property will NOT be HTML-encoded when rendering. Defaults to an HTML blank. So, No need to apply ternary condition for null value.
widget(‘zii.widgets.grid.CGridView’, array(
‘id’ => ‘my-model-grid’,
‘dataProvider’ => $model->search(),
‘filter’ => $model,
‘nullDisplay’=>’NA’ <= This message is display when gridview data cell contain no data.
‘columns’ => array(
‘name’,
‘address’,
…
),
));
?>