<?php $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, 'columns'=>array( 'id', 'survey_id', 'name', 'name_en', array( 'class'=>'CButtonColumn', ), ), )); ?>
How to use CGridView with condition
Posted 18 January 2010 - 06:55 AM
Posted 29 January 2010 - 04:38 PM
Does this also work with MANY_MANY relations?
$criteria = new CDbCriteria; $criteria->with = array('categories') // categories is a MANY_MANY related model $criteria->condition = array('categories = 54') // <-- want to display every ROW that has the category 54
is this possible to add some MANY_MANY intelligent logic to the CDbCriteria like this ? thank you !
Posted 30 January 2010 - 07:50 AM
I solve this in... IMHO very ugly way.
I use some additional model attributes and handful of subqueries.
Currently I try to find more elegant solution