php - how to increase container width to fix GridView scroll in yii2 -
i using yii2 gridview widget showing data in form of table.
as there many fields show, gridview ( below table ) showing scroll it. don't want it.
i want increase container width show table without scroll.
i had search bootstrap.css file not found in directory.
how change gridview width ?
<?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], ......... ['class' => 'yii\grid\actioncolumn'], ], 'tableoptions' =>['style' => 'width: 1800px;'], ]); ?>
or gridview container options
<?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], ......... ['class' => 'yii\grid\actioncolumn'], ], 'options' =>['style' => 'width: 1800px;'], ]); ?>
http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html
http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html#$options-detail
http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html#$tableoptions-detail
otherwise if need larger page container need new layout
add tye new layout in app/views/layout eg:changing container this way
.... <div class="container-fluid"> <?= breadcrumbs::widget([ 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]) ?> <?= alert::widget() ?> <?= $content ?> </div> ....
then assign new layout view before render
public function actionindex() { ...... $this->layout = 'my_new_layout' return $this->render('index', [ 'searchmodel' => $searchmodel, 'dataprovider' => $dataprovider, ]); }
Comments
Post a Comment