hey guys
i want to set a dropdown in one of the gridview column and this is my code:
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' =>
[
['class' => 'yii\grid\SerialColumn'],
[ 'attribute' => 'name' ,'value' => 'name' ],
[ 'attribute' => 'time' ,'value' => 'time' ],
[ 'attribute' => 'country_name' ,'value' => 'country_name' ],
['class' => 'yii\grid\ActionColumn' ],
['label'=>'status', 'format' => 'raw', 'value'=>
function ($model, $id) {
return Html::a('botton', ['/controller/form' , 'id' =>39,'c_id'=>'11' ], ['class'=>'btn btn-primary']);
} ],
],
]); ?>
my question is :
how to get dropdown value and set to to a botton in gridview??
sos?
i tried this code but it not worked:
[
'attribute'=>'attribute name',
'filter'=>array("ID1"=>"Name1","ID2"=>"Name2"),
],