Hi comunity.
How can I change the default URL for the delete button of the Class yii\grid\ActionColumn?
Specifically I need to send other parameters to the controller in addition to the ID.
Thanks.
Hi comunity.
How can I change the default URL for the delete button of the Class yii\grid\ActionColumn?
Specifically I need to send other parameters to the controller in addition to the ID.
Thanks.
Have you tried to extending buttons property?
http://www.yiiframework.com/doc-2.0/yii-grid-actioncolumn.html#$buttons-detail
this is the full code for custom action column in gridview.
[
'label' =>'Action',
'value' => function ($model)
{
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['update', 'id' => $model->intPropertyId])
.''.Html::a('<span class="glyphicon glyphicon-trash"></span>', ['delete', 'id' => $model->intPropertyId], ['data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),'method' => 'post',],]);
},
'format'=>'raw',
],