Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Filtering results - how to re-set filter to show all
#11

[eluser]LuckyFella73[/eluser]
For the "loosing the post var problem":
You have to set up form_validation in your controller
and repopulate the dropdown fields. That way you don't loose
the values anymore. If no rule (form_validation) really
fits, just take "trim" for you have to set up a rule
if you want to repopulate.

Have to leave office soon ... - hope you get it to work.

PS:
Code:
// Controller
$this->load->library('form_validation');
$this->form_validation->set_rules('gyartok', 'Whatever 2', 'trim');
$this->form_validation->set_rules('sorrend', 'Whatever 2', 'trim');

Please look at the user guide for details of repopulating the select
part - unfortunately I don't have the time just now - otherwise I would
like to set up the code for you.


http://ellislab.com/codeigniter/user-gui...latingform


Best wishes - LF
#12

[eluser]predat0r[/eluser]
Reply to myself Smile
So Lucky bro' .. solved with guessed method: when filter is set, i store filter in a ci_session AND the currend uri string also. beginning of the controller is a check, that checks if the current uri is the same as the stored. if not, ie: i changed category, then unsets the session, and all go well.

but my pagination freakshow is waiting to accomplish, ehh..

EDIT: I just saw your post, yes repopulate is a good solution, I'll check thoroughly my solution and when it's not OK, go to form thing.
#13

[eluser]predat0r[/eluser]
Okay lotta of hours but done!

My second problem was the pagination after filtering, and sorting. If I'm not blind until now, I see that the total_rows always gets the same value of query result by default. I set a ci session from the (get)->num_rows(). When I sort or filter, I use this stored session for the total_rows config option, when not, I use the default database query (all products listed by category).

If someone have been ever met with same problems.. maybe helps

Thanks LF noch einmal!




Theme © iAndrew 2016 - Forum software by © MyBB