Yii Framework Forum: Hide extra column # in gridview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Hide extra column # in gridview

#1 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 243
  • Joined: 04-October 12

Posted 20 September 2017 - 02:10 AM

I created a Gridview widget but I have extra column labeled by # mark and it's same the primary key value . I don't know how I can delete it . I don't find any column
related to it in my code .

Posted Image

This is my gridview code
<?php Pjax::begin(); ?>
	<?= GridView::widget([
     	'id'=>'files',
    	'dataProvider' => $dataProvider,
    	'filterModel' => $searchModel,
    	'columns' => [
        	['class' => 'yii\grid\SerialColumn'],
        	'f_id',
        	[
            	'attribute' => 'type',
            	'value' => function($model){
                	return \app\models\Files::getIconOfExtension($model->type);
            	},
              	'format' => 'raw',
            	'filter'=>false,
        	],

        	'original_name',
        	'file_title',
        	[
        	'attribute'=>'upload_date',
        	'value'=>'upload_date',
    	//	'filter' =>\yii\jui\DatePicker::widget(['language' => \app\components\MyGlobalClass::getLanguage(), 'dateFormat' => 'dd-MM-yyyy']),
        	'format' => 'html',
        	],
        	// 'file_code',
        	// 'uploader',
        	// 'upload_date',
        	// 'privacy',
        	// 'password',
        	// 'file_title',
        	// 'file_description',
        	// 'deleted',
        	// 'delete_date',
        	[
            	'class' => 'yii\grid\ActionColumn',
            	'template' => '{download} {view} {update} {delete}',
            	'buttons' => [
                	'update' => function ($url, $model) {
                    	return Html::a('<span class="btn glyphicon glyphicon-edit"></span>', ['update', 'id'=>$model->file_code],['title'=>\Yii::t('app','Update')]);
                	},
                	'view' => function ($url, $model) {
                    	return Html::a('<span class="btn glyphicon glyphicon-zoom-in"></span>', ['view', 'id'=>$model->file_code],['title'=>\Yii::t('app','View')]);
                	},
                	'delete' => function ($url, $model) {
                    	return Html::a('<span class="btn glyphicon glyphicon-trash"></span>', ['delete', 'id'=>$model->file_code],['title'=>\Yii::t('app','Delete')]);
                	},
                	'download' => function ($url, $model) {
                    	return Html::a('<span class="btn glyphicon glyphicon-download-alt"></span>', ['download', 'id'=>$model->file_code],['title'=>\Yii::t('app','Download')]);
                	},
            	],
        	],

        	/*
        	[
            	'class' => 'yii\grid\ActionColumn',
            	'template' => '{download} {view} {update} {delete}',
            	'buttons' => [
                	'download' => function ($url, $model) {
                    	return Html::a(
                        	'<span class="glyphicon glyphicon-cog"></span>',
                        	'#',
                        	[

                        	]
                    	);
                	},
            	],
        	],
        	*/




        	],
	]); ?>
<?php Pjax::end(); ?>

0

#2 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 243
  • Joined: 04-October 12

Posted 20 September 2017 - 02:46 AM

I found solution here
https://stackoverflo...316073#46316073
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users