如何消除yii2中的另一个actionColumn?

时间:2015-11-17 11:36:29

标签: gridview view yii2 action

我是yii2的新手,我想查看学生数据,在这张图片中我想删除删除和编辑图标,如何消除此图标?This is my web view

这是此索引视图的源代码

    GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        'nis',
        'nama_siswa',
        'jenis_kelamin',
         'telp',
         [
           ...],
      ['class' => 'yii\grid\ActionColumn'],

    ],
]); ?>

1 个答案:

答案 0 :(得分:1)

将ActionColumn的template属性用作

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        'nis',
        'nama_siswa',
        'jenis_kelamin',
         'telp',
         [
           ...],
      [
       'class' => 'yii\grid\ActionColumn',
       'template' => '{view}'
     ],

    ],
]); ?>