Multiple cgridviews on 1 view

I would like to put 3 CGridView widgets in one view. Each one will be populated by a separate db query. Currently I have the following in my controller:

		$criteria=new CDbCriteria(array(

			'with'=>array('user', 'topic'),


			'order'=>'topic.topicId desc, createDate desc',




		$dataProvider=new CActiveDataProvider('Rant', array(










And in my index view:

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





			'name' => 'Date',

			'value' => 'Rant::formatDate($data->createDate)',





I’m a bit lost as to how to go about adding an additional two CGridView widgets to my view. Is it possible to pass in multiple dataProviders?

Would it be better to use renderPartial view? If I did use renderPartial would I have to put the CDbCriteria in the view instead of the Controller - the examples I have seen only show it being done that way and it seems like poor separation of display from logic.


I think the most flexible solution would be to inherit two (or three) customized submodels (each with their own search method, that is).

You will pass models A,B,C from the controller, possibly passing $A=>model and a grid id to a partial (same for B,C), just refering to $id and $model in each partial.