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.


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

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.