Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Set default page size


Go to End


12 Posts   3861 Views

Avatar
rob.s

Community Member, 78 Posts

9 September 2010 at 2:07am

Hi,

is there an other possibility to change the default page size of DOM than changing the line:

protected $per_page = "10";

in DataObjectManger.php ?

Greetz,

Robert

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 September 2010 at 2:09am

$yourDOM->setPageSize(50);

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
rob.s

Community Member, 78 Posts

9 September 2010 at 2:26am

Edited: 09/09/2010 2:28am

Hi UncleCheese,

thanks for your fast reply.
This method does not work for me:

if i use this method, the pulldown in the right bottom corner, where the number of displayed items can be changed, does not work anymore (using FileDataObjectManager and ManyManyDataObjectManager)

I use the DOM from SVN trunk and SS 2.4.1

Kind regards,

Robert

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 September 2010 at 2:41am

What does "doesn't work" mean?

You can update the values in that dropdown with $yourDOM->setPageMap(), BTW..

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
rob.s

Community Member, 78 Posts

9 September 2010 at 3:02am

Edited: 09/09/2010 3:05am

Hi Uncle,

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

works like a charm ......

sry for not explaing what happens exactly ...

if i use

$manager->setPageSize(20);

the selected value inside DOM is '10'. And if i change this value, no event (reload) is fired. Nothing happens.
(no JS Error is shown in Firebug)

BTW the DOM is used inside ModelAdmin

Thx for your help,

Robert

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 September 2010 at 3:10am

Ok, so using setPageMap() fixed the issue?

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
rob.s

Community Member, 78 Posts

9 September 2010 at 3:34am

Hi Uncle,

this is OK for me ....

Too bad the code

$manager->setPageSize(20);

does not work for me..

Thanks a lot for your time and help,

Robert

Avatar
rob.s

Community Member, 78 Posts

10 September 2010 at 6:25pm

but FileDataObjectManager is ignoring the setting

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

The Dropdown is correctly populated with the values 25, 50, 75, All

But there are only 10 records displayed on load ....

Go to Top