Answer the question
In order to leave comments, you need to log in
Yii2 in grid view to make a text filter on the associated field?
Made a connection in the model. In grdiview the data comes from the linked table but there is no filter. How to make a filter appear?
[
'label' => 'Полное имя',
'attribute'=>'fullname',
'filter'=>workers::getFullname(),
'format' => 'text',
'value' => 'workerInfo.fullname',
],
Answer the question
In order to leave comments, you need to log in
Solved the problem
If you need a dropdownlist, then do the following
In the model, add a link
public function getWorkerInfo()
{
return $this->hasOne(workersInfo::className(), ['userid' => 'userid']);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question