Multiple CGridViews

Just wanted to know if I’m going about this in the correct way. I need to display 3 CGridViews on the same page. Each one has a different criteria. So what I have done is:


  • Created 3 seperate search() functions with their own criteria


  • Created 3 seperate cgridviews, with their own ‘id’, ‘dataProvider’ and ‘filter’ properties


public function actionAdmin()


	$model1=new Enquiry('search1');

	$model2=new Enquiry('search2');

	$model3=new Enquiry('search3');


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

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

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








	$this->render('admin', array(






Is this the correct method?

No, like that the filter will all works together, because use the same input.

You should find a way for differentiate the ‘$_GET[‘Enquiry’]’.

You can create 3 class with different name (CHtml::resolveName use get_class, no way to specify another name) or you can try to use the tabular_input in a gridView, but I have no idea about how to do… )))

Yes this looks like it will be tricky to do. Anyone have any more suggestions?