Dynamic results with filtering and pagination |
[eluser]FabioAntunes[/eluser]
Hi there, I've been struggling with this all day and I didn't find a solution that pleased me. So here's the deal, I have a page where the user can filter some data, imagine I have a page displaying some students and the filters I have are: Name-> type input text, Student number -> type input text, Id of the class -> type multi select. (this will generate an array with multiple values) The user press the submit button to filter and I will get the values with POST. Everything works great the problem is with the pagination for the filtered data, as I can't get the values passed through post so i can show let's say page two. I tried to solve this using flashdata, but flashdata doesn't support multidimensional array, with normal session I wouldn't know when to flush it, passing the parameters through url probably is the best solution but how? With something like this? www.myexample.com/student/filter/2/Name/John/Number/123/idclass/1/idclass/2/idclass/3 Where the first number(2) is the page and the rest the filtering parameters? I hope I had made myself clear. Thanks
[eluser]weboap[/eluser]
this url doesnt look right: Code: www.myexample.com/student/filter/2/Name/John/Number/123/idclass/1/idclass/2/idclass/3 it should be Code: www.myexample.com/student/filter/John/123/1/2/3/6 Code: $config['uri_segment'] = n; //where your pagination will be hope it help your url logic!
[eluser]FabioAntunes[/eluser]
In your example URL you used two slashes to comment? or they really belong to the url? One more thing, the pagination number must be always the last one? I was hoping that somehow the pagination number were the first parameter in the URL
[eluser]InsiteFX[/eluser]
CodeIgniter Users Guide - URI Class CodeIgniter Users Guide - Pagination Class
|
Welcome Guest, Not a member yet? Register Sign In |