Hi everyone I recently found the wiki Searching and sorting by related model in CGridView in the following link http://www.yiiframework.com/wiki/281/searching-and-sorting-by-related-model-in-cgridview … now i got the problem that when I change the page of the CGridview doesnt change it always shows the same content I’ve tried with two solutions but the result is the same and also with different Databases one in MySQL and one in MSSQL well I hope you could help me i will appreciate a lot, thanks in advice
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->with=array('producto');
$criteria->compare('t.idProdClient',$this->idProdClient);
$criteria->compare('t.idProducto',$this->idProducto,true);
$criteria->compare('producto.nombre',$this->producto_search,true);
$criteria->with=array('cliente');
return new CActiveDataProvider(get_class($this), array(
'criteria'=>$criteria,
));
}
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
.......
// Please remove those attributes that should not be searched.
array('idProdClient, idProducto, codigoCliente, activo, idConfigProd, producto_search', 'safe', 'on'=>'search'),
);
}
As i mentioned before I’ve tried with different databases and different projects I dont know if you could send me a full example of how you do it? thanks again for your support.
The only issue with posting the project online is that this project is an intranet… I dont if I can do it… let me do a simple project to show you my issue, and i will post this test project online… Thank you very much!
I think i resolved partially my problem, now the content changes when you change page… But when i add this line on the search function, the content doesnt change
I tried with this Searching and sorting a column from a related table in a CGridView approach and I get the same result i cant change page and when i remove the line