7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Set default page size
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 1813 Views |
-
Set default page size

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
-
Re: Set default page size

9 September 2010 at 2:09am
$yourDOM->setPageSize(50);
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Set default page size

9 September 2010 at 2:26am Last edited: 9 September 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
-
Re: Set default page size

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 -
Re: Set default page size

9 September 2010 at 3:02am Last edited: 9 September 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
-
Re: Set default page size

9 September 2010 at 3:10am
Ok, so using setPageMap() fixed the issue?
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Set default page size

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
-
Re: Set default page size

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 ....
| 1813 Views | ||
| Go to Top | Next > |

