I am using Yii2 gridview with custom action button. On click custom button i want to update status of that record and hide that row from gridview. Also want to show success message.
[
'class' => 'yii\grid\ActionColumn',
'header'=>'Actions',
'template' => '{confirm}',
'buttons' => [
//view button
'confirm' => function ($url, $model) {
return Html::a('Confirm', $url, [
'title' => Yii::t('app', 'Confirm Address'),
'class'=>'btn btn-success',
]);
},
],
'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'confirm') {
return Url::to(['customers/confirmaddress','id'=>$model->id]);
}
}
]