Multiple Cgridviews With Different Scopes, Scopes Are Conflicting

Firstly, thanks in advance to anyone who can help.

I have 3 CGridView’s on a single page. One is the general CGridView generated on Gii’s admin CRUD page, and the other two are based on scopes from within the same model.

The CGridViews which use scopes are interfering. They’re both displaying the ‘needapproval’ scope, rather than one displaying ‘needapproval’, and the other displaying ‘recent’, as I thought I’d defined.

My scopes array in PricingAgreementsUpdates model:




function scopes(){

	array(

		'needapproval'=>array(

			'condition'=>'supplierStatusId != 2',

			'order'=>'submitTime DESC',

		),

		'recent'=>array(

			'order'=>'submitTime DESC',

			'limit'=>5,

		),

	)

}



dataProviders:


...

'id'=>'agreements-recent-activity-grid',

'dataProvider'=>new CActiveDataProvider(PricingAgreementsUpdates::model()->recent())

...


'id'=>'agreements-unapproved-grid',

'dataProvider'=>new CActiveDataProvider(PricingAgreementsUpdates::model()->needapproval())

It seems like the needapproval scope is being called fine - both grids don’t display any items when no items need approval - though I need one of the grids to show all recent items regardless of supplierStatusId.

Please let me know if anyone requires more information.

Thanks again in advance for any help offered!

sorry to bump… no one’s got any clues?