Hi guys, I need help with this problem
I have a gridview with button for every row like on the picture. I want to have my own button for select all rows which are displayed right now. How can i do that ? Button should be at the place, where is a red circle, on the picture
This is my gridview
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'summary'=>'',
'rowOptions'=>function($model)
{
if($model->add == 1) {
return ['class'=>'success'];
}
},
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'class' => 'yii\grid\ActionColumn',
'template'=>'{add}',
'buttons'=>[
'add' => function ($url, $model) {
return render_button($model->add ,$url);
}
]
],
'shop',
'category',
'product:ntext',
'prise',
'shop_category:ntext',
[
'attribute' => 'img',
'format' => 'html',
'label' => 'Image',
'value' => function ($data) {
return Html::img( $data['img_url'], ['width' => '70px']);
},
],
[
'label'=>'shop',
'format' => 'raw',
'value'=>function ($data) {
return Html::a('buy',$data->url);
},
],
'delivery_date',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
thanks for any help