Reputation: 38342
Hi i am facing a issue with the pagination helper. I am sorting the records based on user criteria like date range etc via drop downs . And it works fine. It paginates properly. But when i click on page 2, it shows page 2 of all results an not the sorted results. How can i fix it. The fields are sorted via POST and not GET and don't want it to be GET
Upvotes: 0
Views: 129
Reputation: 6047
You can try to store the post in the session, and then to fetch it when the page is loaded.
i.e.
if(isset($this->data)){
if(isset($this->data['clear'])){ //some field (button) which will clear the session
$this->Session->delete('post');
unset($this->data);
}
$this->Session->write('post', $this->data);
}
if($this->Session->read('post')){
$this->data = $this->Session->read('post');
}
If you want take a look on this component: Filter component. The post is a little bit old, but the component is adequate still and I am using it in my projects :)
Upvotes: 1
Reputation: 14365
It's hard to reverse engineering your source from a screenshot but i think the main problem is you're using POST therefore when user clicks to '2' you need to use some javascript to mimick a POST request.
Upvotes: 0