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
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' => $dataProvider,
'formatter'=>[
'class' => 'yii\i18n\Formatter',
'nullDisplay'=>'This is empty'
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name'
]
]);?>