Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Set default page size

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2248 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Set default page size Link to this post

    What happens if you do:

    $manager->setPerPageMap(array('25','50','75'));
    $manager->setPageSize('25');

  • rob.s
    Avatar
    Community Member
    78 Posts

    Re: Set default page size Link to this post

    Hi UncleCheese,

    same behaviour as described above:

    On load it displays the correct amout of files: 25
    The select box in the right bottom corner is populated correct ('25','50','75','ALL')

    But nothing happes when i change the value
    (still no JS Errors in firebug)

    Greetings,
    Rob

  • tmkp
    Avatar
    Community Member
    42 Posts

    Re: Set default page size Link to this post

    Hi,
    I'm having the same issue on 2.4.5, DOM r540.

    ...

          $manager = new ImageDataObjectManager(
             $this,
             'Images',
             'GalleryImage',
             'Image',
             array(
                'Text' => 'Bildunterschrift'
             ),
             'getCMSFields_forPopup'
          );

          $manager->setPerPageMap(array('25','50','75'));
          $manager->setPageSize('25');
    ...

    The Dropdown populates correctly, but changing the value does nothing. Pagination in the header area is working okay though.

    Btw. i would love love love to eventually see an option to make DOM always show all dataobjects and disable pagination and the PageSize dropdown completely. I'm almost exclusively using it in setups where clients are using a small number (10-30) of dataobjects with drag and drop sorting on, and things just get unnecessarily cluttered and confusing with all the extra viewing options.

    Anyway, thanks for the great work and greetings from Germany!

    Andi

    ----------------
    EDIT:
    It seems that leaving the PerPageMap at it's default (10, 20, 30, 40, 50) and just adding $manager->setPageSize('50'); already breaks the dropdown. 50 items are being shown, but again changing the dropdown value does nothing. Also, on pageload the dropdown incorrectly shows up with 10 as selected value.

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Set default page size Link to this post

    Hi!

    Old thread, but i can confirm that here setPageSize breaks the dropdown PerPageMap.

    Bye,
    Juan

    2248 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.