2016-03-31 19 views
0

GridViewの幅を画面サイズに合わせて調整するのを避けることができます。列のデータが大きすぎると、ブラウザで水平スクロールが有効になり、ライン? 私は別の値でこれを試してみたが、何の成功:GridViewで列幅の自動調整を有効/無効にする

'contentOptions' => ['style' => 'width:100px'] 

答えて

2

あなたはこのhttp://getbootstrap.com/css/#responsive-utilities

<?= GridView::widget([ 
    'dataProvider' => $dataProvider, 
    'layout' => "\n{items}\n", 
    'filterPosition' => '', 
    'columns' => [ 
.................. HIDING A COLUMN ON A SMALL DEVICE ----------------- 
     [ 
      'header'=>'Time', 
      'headerOptions' => ['class' => 'hidden-sm'], 
      'contentOptions' => ['data-columnname' => 'Address', 'class' => 'hidden-sm'], 
      'format'=>'raw', 
.................. Merging info in 1 column on a small device the address and locations are their own columns, on small device the columns are hidden and the info is available in the Venue column----------------- 
     ], 
     [ 
      'contentOptions' => ['data-columnname' => 'Venue'], 
      'attribute'=>'VENUE', 
      'header'=>'Venue' . Html::tag('span', '/Address', ['class' => 'visible-sm-inline']), 
      'value'=>function ($model, $key, $index, $widget) { 
        return $model->VENUE . 
        Html::tag('span', '<br>' . $model->ADDRESS, ['class' => 'visible-sm-inline']) . 
        Html::tag('span', '<br>' . $model->LOCATION, ['class' => 'visible-sm-inline']); 
      }, 
      'format'=>'raw', 
     ], 
    ], 
]); ?> 
を達成するために、ブートストラップ応答のユーティリティを使用することはできません
関連する問題