Cgridview For Only Selected Records

newbie here so please reply with simple answers… :)

i am trying to use the widget cGridView to display records from my Widgets table - but only certain widgets that built by a specific company (another table and model);

i can easily get the cGridView to display records from the widgets table, showing only the columns i want… but how do i get it to only display the records for a select company and NOT all the records on the widgets table… companyID is a field on the widgets table and the company table has the following columns (ID, companyName, companyAddress, etc).

Thank you.

Hi,

These kind of filteration you have to do during cactivedataprovider construction…

(i.e) during fetching the result… its quite simple

you can follow this sample

http://www.yiiframework.com/forum/index.php/topic/24210-using-2-conditions-in-cactivedataprovider/

where does this function go??? in the controller?? the model?? or in my actual program that is viewing the records of the table??

also, this program that i am creating is not only listing the rows of a table but allowing the user to update and delete them similiar to the GII generated admin.php program - except i don’t want to show all records only ones that match my criterea.