Hello, I have a list of items in the admin (manage) page for my Stories model. Each Story has an Engine associated with it. The first column in this admin view is “Engine Name”, which is part of the Engine table. This relationship is defined in the Story and Engine model files. However, on this page I can’t search by Engine Name. The input box for filtering items is gone for the Engine Name, but still there for the other columns. Also, I’m not sure how to allow for searching by Engine Name in the advanced view either. Any help is appreciated, thanks!
public function search() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->with = array('engine'); // use name of your relation here
$criteria->compare('id', $this->id);
$criteria->compare('engine.name', $this->engine_id);
....morecode...