help : CodeIgniter Search and pagination ? |
[eluser]ludo31[/eluser]
Hello ; I need your help ; I try to make a simple search with pagination and I have a problem that was discussed here : http://www.devessence.com/2009/10/11/cod...-segments/ in my view file : Code: <?php echo form_open('annonce/rechercher');?> and in my controller : Code: public function rechercher () when I try to run it run and make the research but when I click on page 2 nothing !! I think the problem is here : Code: $province = $this->input->post('province'); because when I try to change like that Code: //$province = $this->input->post('province'); help me please I try to find a solution !! thanks
[eluser]aquary[/eluser]
It's not a conflict. There are no data posted when you click on the pagination links, which mean $province and $categories would always become FALSE after the first page. You have to also send both variables into the URI as well. Code: public function rechercher ($province=0,$categories=0, $offset=0) Though not so effective when you have tons of filters available, this is the simplest one to make. Else, you'll have to store the filters inside a table or something similar.
[eluser]ludo31[/eluser]
Thnaks for your reply ; it shoes the second page but the problem is I can't return at the page 1 when I click on page 2 the url : http://localhost/MonSite/index.php/annon...cher/1/1/2 and the current page stay at one
[eluser]skunkbad[/eluser]
It's a lot easier to do a pagination with CI using ajax. The reason is that the form w/ search terms doesn't change, so as the pagination links are clicked on, the ajax request can just grab the form elements each time. There is no fallback to users who have javascript disabled, but if you want an example, check on the Manage Users page in Community Auth.
[eluser]ludo31[/eluser]
Skunkbad can you explain more ?? I try with this Ajax library but it doesn't work http://codeigniter.com/wiki/AJAX_Paginat...on_Library |
Welcome Guest, Not a member yet? Register Sign In |