yii2 dropdown in gridview widget filter
Hi the answer is simple from what you think.
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'title',
//don't use this:
//'statusId',
//use this instead:
[
'attribute' => 'statusId',
'filter' => [ "1"=>"open", "2"=>"in progress", "3"=>"closed" ]
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>