Click here for EduSec Demo EduSec Screenshots

nullDisplay property in Cgridview

On 2013-06-10 - By Ravi Thanki

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(