Expanded row word wrapping

Web Tips Q & ACategory: Krajee Yii2 ExtensionsExpanded row word wrapping
melaniecarr23 asked 6 months ago

How can I wrap the contents of my expanded column detail so it shows the whole answer in my faq?  I’ve tried many things, including setting noWrap => false but nothing fixes it.
faq/index.php

 <?php Pjax::begin(); ?> <?= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'responsive' => true,
'bootstrap'=> true,
'columns' => [
//['class' => 'yii\grid\SerialColumn'],

//'id',
[
'class'=>'kartik\grid\ExpandRowColumn',
'value'=> function ($model,$key,$index,$column) {
return GridView::ROW_COLLAPSED;
},

'contentOptions' => ['style' => 'max-width:960px; overflow: auto; word-wrap:break-word;'],
//'attribute'=>'faq_answer',
//'enableRowClick'=> true,
//'expandIcon'=> '<span class="glyphicon glyphicon-expland"></span>',
//'collapseIcon'=> '<span class="glyphicon glyphicon-collapse"></span>',
'detail'=> function($model,$key,$index,$column) {
$searchModel = new FaqSearch();
$searchModel->id = $model->id;
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);

return Yii::$app->controller->renderPartial('faq-details',[
'model'=> $searchModel,
'dataProvider'=>$dataProvider,
]);
},
],
'faq_question',
//'faq_answer',
//['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php Pjax::end(); ?>

faq/faq-detail.php

<?= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'responsive' => true,
'bootstrap'=> true,
'responsiveWrap'=>true,
'columns' => [
[
'class'=>'kartik\grid\DataColumn',
'attribute'=>'faq_answer',
'format'=>'raw',
'noWrap'=>false,
'contentOptions' => ['style' => ['overflow: auto;', 'word-wrap:break-word;']],
],
//'faq_answer',
//['class' => 'yii\grid\ActionColumn'],
],
]);
?>

Login or register to contribute or comment.

Login   Register