you have to provide setter for this attribute (I assume you already have getter), add this attribute to ‘safe’ on ‘search’ and add some code to ‘search’ function which prepares CActiveRecordDataProvider with search results.
Well, there must be a relationship between the data in the database and the categories you display - either that or your application makes no sense Either way, would you mind posting your categories() method so we can see exactly what it’s doing?
It’s 2am here, and I’m about to head off without really studying your code. However, having had a brief glance, it looks like you’d be better of creating the necessary relationships between your models rather than manually performing the database operations as you have above. If you were to take the route of setting up those relations, you should be able to set the filter up as you normally would within the grid view.
I added the new field. Almost everything is working right, except one thing.
If I want to search something in the custom field I have just added, I noticed that with pagination it will not work right. If there are more results than on a page…for the first page the results are fine …the count number of results is fine…but when I go to page 2 the count results will be reset and also there will be listed all the records again, of course with pagination. I would like to be able to see the results for my search in the page 2 and so on…
Do you have any idea? I think is an issue related to Yii pagination…but I coudnt’t find any solution yet.