This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » Pagination in Admin
Pagination in Admin [message #16099] Fri, 17 November 2006 10:04 Go to next message
flarian  is currently offline flarian
Messages: 37
Registered: November 2006
Member
Hello!

I've got the following situation:
* Admin-Generator on 0.6.3
* List showing ca. 350 entries on pages with 10 entires each

Now, if you edit an entry and go back to the list, you will always land on the first page. the more pages you've got, the more annoying is this behaviour.

Two questions:
* Is this resolved in the latest release?
* How can i adapt this to 0.6.3? Could you post any info about this issue?

Many thanks in advance.

Yours

Ralf

Re: Pagination in Admin [message #16106 is a reply to message #16099 ] Fri, 17 November 2006 11:26 Go to previous messageGo to next message
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

I never noticed that, but you are right, here is a small patch for the action.class of the admin generator theme :

in executeList() function replace :

$this->pager->setPage($this->getRequestParameter('page', 1));


by :

$this->pager->setPage($this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'sf_admin/<?php echo $this->getSingularName() ?>')));


in executeList() function add at the end :

    // Save page
    if ($this->getRequestParameter('page')) {
        $this->getUser()->setAttribute('page', $this->getRequestParameter('page'), 'sf_admin/<?php echo $this->getSingularName() ?>');
    }



in the process() function, before the 1st removenamespace statement add :

      $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/<?php echo $this->getSingularName() ?>');


That should do the job. Very Happy


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
Re: Pagination in Admin [message #16112 is a reply to message #16106 ] Fri, 17 November 2006 12:16 Go to previous messageGo to next message
flarian  is currently offline flarian
Messages: 37
Registered: November 2006
Member
Thanks for your quick response! I'll try this.
Re: Pagination in Admin [message #16113 is a reply to message #16099 ] Fri, 17 November 2006 12:19 Go to previous message
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

was a good occasion to do it for my project too. Smile


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
Previous Topic:[helper]Define date format in input_date_tag
Next Topic:_in_place_editor
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software