Gridview (Not Set)

Hi,

Is there a way to display an alternative if the table cell is empty other than the red (not set) which is currently being displayed?

Regards

I fall to this situation too, It been a long time, you may not need this anymore, hopefully, it’s useful to other people.

You can use the nullDisplay property of yii\i18n\Formatter to display what you want.

<?= GridView::widget([

'dataProvider' =&gt; &#036;dataProvider,


'formatter'=&gt;[


	'class' =&gt; 'yii&#092;i18n&#092;Formatter',


	'nullDisplay'=&gt;'This is empty'


],


'columns' =&gt; [


	['class' =&gt; 'yii&#092;grid&#092;SerialColumn'],


	'id',


	'name'


]

]);?>