Paginate search criteria

Dear All,

After I display search result on the page and click second page I am loosing search criteria. Is there any way to carry search criteria to other pages ?

You have to include the datagrid in the form of search criteria, and change CLinkPager in order to create submitbutton instead of normal buttons.

This can be done extending CLinkPager and overriding the method createPageButtons().

Maybe this helps you:


I couldn’t download files in your link. Is it possible to give JS function


What is datagrid exactly?

By the way I just create a new class call PostPager extends from CLinkPager and update the createPageButton function like

return '<li class="'.$class.'">'.CHtml::link($label,'javascript:goPage('.($page+1).')').'</li>';

So it is calling goPage function and this function submits the form. So I can able to get the search criteria in this way.

Nice solution, thank for sharing.

In effect datagrid doesn’t mean nothing, I don’t know what I was thinking when I answred you… sorry! <_<

I meant to change the Pager of CDataGrid, as yo did it.