Hi all, I’m stuck at trying to make rational table cells searchable in GridView widget. Is there a simple way to do this?
I’ve found some tutorials, but they are all on yii1.
Here’s the structure example of what I have:
Clients:
clientid
name
Addresses:
addressid
address
client_id
1 Client can have many Addresses.
I’ve created them and generated the code with Gii and the relations are defined nicely in the models.
In the GridView I can access the Client name really easily like so:
[
'label' => 'Clients Name',
'value' => 'clients.name',
],
But these fields are not searchable or sortable. I understand that I have to change the AddressSearch model, but I’m failing do do it successfully.
The image shows what it looks like. I want to make the "Klienta Vārds" and "Uzvārds" searchable.
Any help or pointing in the right direction appreciated
Thank you