Greetings!!
I have a big doubt and i would like to resolve this.
I created manually a model that extends CFormModel with the name "Routing". Basically this model just merge two tables from database. My ROUTINGController has a function actionAdmin():
public function actionAdmin()
{
$model=new routing('routing');
$model->unsetAttributes();
if(isset($_GET['routing']))
$model->attributes=$_GET['routing'];
$rawData=Yii::app()->db->createCommand('SELECT * FROM routing_rule INNER JOIN routing_destination ON routing_rule.serviceid=routing_destination.serviceid')->queryAll();
$dataProvider=new CArrayDataProvider($rawData, array(
'keyField'=>'SERVICEID',
'sort'=>array(
'attributes'=>array('SERVICEID'),),
'pagination'=>array('pageSize'=>20),
));
$this->render('admin', array(
'model' => $model,
'dataProvider' => $dataProvider,
));
}
My admin view uses CGridView to show the results with the options to manipulate the data (view, update, delete, advanced view).
What i am looking for is to use the AdvancedView. Since im using CFormModel and CArrayDataProvider i can’t use the CDbCriteria to filter the results. I cant even understand how the framework saves the filters we want for search.
What i really would like is to have a function in my "Routing" model public function search() like the gii when generates the model from DB (extending CActiveRecord in spite of CFormModel).
I apreciate any help thank you