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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

ModelAdmin Limiting the search results


Reply

6 Posts   1357 Views

Avatar
patjnr

4 December 2009 at 9:19pm Community Member, 101 Posts

is there any way of limiting the number of results displayed on the CTF in ModelAdmin to 1-10 .... 11-21. currently its just display all my search from 1 to 40 and only 1 to 13 a visible

tx

P

Avatar
CodeGuerrilla

2 February 2010 at 5:33pm Community Member, 105 Posts

*bump* I would also like to know how to change how many results are shown in the CTF before it begins paging, also while your there how do you make the header fields sortable (onclick)?

Avatar
CraftsMan

11 March 2011 at 11:12am Community Member, 35 Posts

bump! you guys make any further progress with this?

Avatar
StuM

11 March 2011 at 3:30pm Community Member, 56 Posts

In your ModelAdmin class add

public static $page_length = 10;

I just found that in ModelAdmin::getResultsTable(), tried on my 2.4.5 install and it worked fine

Avatar
CraftsMan

12 March 2011 at 6:36am Community Member, 35 Posts

My problem was the pagination wasnt kicking in.
But I realise this is an issue with the PanelModelAdmin I am using.

Avatar
Martijn

26 March 2011 at 8:24am Community Member, 271 Posts

This should work in panelmodeladmin the same as in
Modeladmin....