Hi,
I’m trying to display a CGridView list using the content taken from 2 tables - and I can do that without any issues - I made 2 models, set a relation, specified criteria, attributes, rules - and it works fine - the only problem I have is that when I add a column that should read the data from the joined table - it only displays it, but doesn’t filter using the specified value.
That’s my column:
array(
'header'=>'User',
'name'=>'owner',
'type'=>'html',
'sortable'=>true,
'value'=>'$data->user_info->name',
),
“Owner” is an integer - it represents user’s id. I want to display user’s name from the table “user_info” that is stored in “name” column. CGridView lists up the user’s names, but filters using “owner” (integer). How can I change that? Trying to define “user_info.name” or something similar in “name” field didn’t change anything.
All I want is to display the "name" field from joined "user_info" table and filter using the string "name" from "user_info" table. Any suggestions?