No filter box at CGridView


I have two AR classes, User and Domain. They are connected by the relations() function of the User class:


A list of users with their related domain should be displayed in a CGridView. The related action is defined as

public function actionManage()


		$model = new User('search');



		$model->unsetAttributes();  // clear any default values





and the Grid itself as

<?php $this->widget('zii.widgets.grid.CGridView', array(

















)); ?>

I created the column for the domain name using two different ways - but none of them generates a search box - the box is generated only for the first column.

I tried to add the filter argument (as read in the documentation) to generate a Drop Down List, but this didn’t help either.

Did I forget something or what else can I do to get the filter box?

Thanks in advance!

I think that CGridView cannot understand what property of the model should use.

Try adding a new property to the model on user, named domainName, add to safe attributes and add the addCondition in the function search.

Then in the cgridView:







This should work.