Obrigado Leandro!
I worked on another solution for the text field issue:
i created a auxiliary field, in the model, as you can see
class CommunityUser extends CActiveRecord
{
/**
* The followings are the available columns in table 'community_user':
* @var integer $user_id
* @var integer $community_id
* @var integer $is_suspended
* @var integer $can_invite_users
* @var integer $can_manage_objects
* @var integer $can_manage_templates
* @var integer $can_deactivate_community
* @var integer $can_manage_members
* @var integer $can_close_community
* @var integer $can_manage_requests
*/
public $aux_username;
....
public function searchPerCommunity($communityId)
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->join = 'JOIN user as t2 ON t2.id = t.user_id';
$criteria->compare('user_id',$this->user_id);
$criteria->compare('community_id',$communityId);
$criteria->compare('is_suspended',$this->is_suspended);
$criteria->compare('can_invite_users',$this->can_invite_users);
$criteria->compare('can_manage_objects',$this->can_manage_objects);
$criteria->compare('can_manage_templates',$this->can_manage_templates);
$criteria->compare('can_deactivate_community',$this->can_deactivate_community);
$criteria->compare('can_manage_members',$this->can_manage_members);
$criteria->compare('can_close_community',$this->can_close_community);
$criteria->compare('can_manage_requests',$this->can_manage_requests);
//
// $criteria->compare('user.name',$this->user_id,true);
//
// $criteria->compare('user.photo',$this->user_id);
$criteria->addSearchCondition('user.username',$this->aux_username,true);
$criteria->with = 'user';
return new CActiveDataProvider('CommunityUser', array(
'criteria'=>$criteria,
));
}
and the view
array(
'name'=>'user_id',
//'filter'=>CHtml::listData(CommunityUser::model()->with('user')->findAllByAttributes(array('community_id'=>$community->id)), 'user_id', 'user.username'),
'filter'=>CHtml::activeTextField($dataProvider,'aux_username'),
'value'=>'User::model()->findByPk($data->user_id)->username',
),
And it’s working!!!! Now, using this solution, i can make all the relations i want without worrying with cgridview and cdatacolumn issues.