Hi folks,
I’ve done a fair bit of digging around both on here on and on google for an answer to this but to my surprise I have not been able to find one.
The thread title says it all, really - I want to have a concatenated string to display in my dropdown filter in GridView.
Here is that I have so far…
'filter' => Html::activeDropDownList($searchModel, 'competitor',
ArrayHelper::map(
Competition::find()->asArray()->all(), 'id', 'competitor_id'),
['class'=>'form-control','prompt' => 'Select']
),
So I would like to be able to populate with concatenated related data here - namely the competitor_last_name, competitor_first_name and competitor_number, which are in the Competitor table/model. The aim is to produce something like ‘Bloggs, Joe - 001’.
I thought this would be quite easy to do, but I can’t seem to find away to do it. Can anyone help?
Thanks,
U4EA