How to delete a glyphicon-pencil or edit, view, delete a button from a gridview page in yii2?

enter image description here

How to remove glyph-pencil-icon and icon-icon from a specific page in yii2

+4
source share
3 answers

You can do with a template in actionColumn

 <?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        .........
        [
            'class' => 'yii\grid\ActionColumn',
            'template' => '{view} {delete}',
        ],
    ],
]); ?>
+4
source

If you are still using Yii 1. *, then that would be helpful.

Open this file: framework / zii / widgets / grid / CButtonColumn.php

Delete and make $ template as follows:

public $template='{view} {update}';
0
source

For me, there was a line below for all data representations as-

// ['class' => 'yii\grid\ActionColumn'],  

I just commented on this and worked for me.

0
source

Source: https://habr.com/ru/post/1621332/


All Articles