Pagination without loss research

Hi everyone!

I need for any example or suggestion to create pagination without loss research.

Example in my application:

(Controller)




// Formulário para pesquisa

$modelForm = new ImoveisPesquisar;

$pesquisa = false;

		

$criteriaBuscar = new CDbCriteria();

$criteriaBuscar->order = 'id DESC';

$criteriaBuscar->compare('status',1);

		

if(isset($_POST['ImoveisPesquisar']))

{


$comp = '';

			

if(isset($_POST['ImoveisPesquisar']['id_negocio']) && $_POST['ImoveisPesquisar']['id_negocio'] != '')


$criteriaBuscar->condition = $comp . 'id_negocio = ' . $_POST['ImoveisPesquisar']['id_negocio']; $pesquisa = true; $comp = ' AND '; $modelForm->id_negocio = $_POST['ImoveisPesquisar']['id_negocio'];

...

				

}

		

$count=Imoveis::model()->count($criteriaBuscar);

$pages=new CPagination($count);

$pages->pageSize=24;

$pages->applyLimit($criteriaBuscar);

$modelImoveis = Imoveis::model()->findAll($criteriaBuscar);

		

			

$this->render('pages/buscar-imovel',array('modelForm'=>$modelForm,'modelImoveis'=>$modelImoveis,'pagesImoveis'=>$pages,'pesquisa'=>$pesquisa));



But when i click in page “2” (example), THE FILTERS ARE LOST :(

Hi,

i use this extension to keep my filter during navigation:

http://www.yiiframework.com/extension/remember-filters-gridview

But i’m not sure that before using it my filter was lost when i changed page.

I posted something which I then realized did not answer your question. Oops!

Would love to have an update on this issue, because that extension looks interesting.

:mellow: