Answer the question
In order to leave comments, you need to log in
How to handle value data in GridView?
There is a loop that generates columns for the GridView:
$columns = [];
foreach ($this->paramLabels() as $id => $label) {
$columns[] = [
'attribute' => "paramValues[{$id}]",
'filter' => Html::activeTextInput($this, "paramValues[{$id}]",['class' => 'form-control']),
'label' => $label,
'contentOptions'=>['data-param'=>"{$id}"],
'value' => "paramValues.{$id}.value",
];
}
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $columns,
]);
<div class="">...</div>
example
Answer the question
In order to leave comments, you need to log in
'value' => function($model){return '<div class="">' . $model->id . '</div>';},
'contentOptions'=>['data-param'=>"{$id}", 'class'=>'someClass'],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question