Hi,
I have a table “procedimiento” who has a foreign key to table “organizacion”. I have generated CRUD code with gii. I got a GridView working fine for table “procedimiento”. I’m able to show “organizacion” fields using this code (see “$data->organizacion0->nombre” reference):
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'cod_sia:ntext',
'nombre:ntext',
[
'header' => 'Responsable',
'value' => function ($data) {
return $data->organizacion0->nombre;
}
],
'comentario:ntext',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
but I can not search in this column. I found some links with useful information for Yii 1.1 but nothing for Yii 2.