Calling a function on grid action coumn click
问题 I have a grid in yii that has an action column with a custom button I would like to call function when the grid button is clicked but i get an error This is my code: [ 'class' => 'kartik\grid\ActionColumn', 'template' => '{approve}{new}{reject}', 'buttons' => [ 'approve' => function ($url, $model) { return Html::button('<i class="fa fa-check"></i>', ['value' => Url::to('approvetruck?id='.$model->id),'style' =>'background:none;border:none;','id' => 'approve','onclick'=>'alert('.$model->id.')']