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, Ed, biapar, Willr, Ingo, swaiba

[SOLVED] Remove limit from gridfield list

Go to End

3 Posts   1103 Views


Community Member, 96 Posts

31 January 2014 at 9:39pm

Hey guys,

has anyone an idea how to remove the limit of gridfield list? Normally a gridfield list shows only 20 records or so.
I found also a few links on internet about GridField_DataManipulator and something from Willr:

But I can´t get it work.

$config = GridFieldConfig_RelationEditor::create();
$config->addComponent(new GridFieldPrintButton());
$config->addComponent(new GridFieldDeleteAction());

$WorkField = new GridField(
            	$this->JobWorktimes()->sort('Date', 'ASC')->limit(null), 


Forum Moderator, 1391 Posts

2 February 2014 at 2:35am

I don't think you can actually remove the limit, the GridField depends on the GridFieldPaginator and the GridFieldPaginator doesn't seem to let you set the number of pages to 0 (zero) or otherwise remove the limit. For me, I'm not sure about removing the limit altogether - I wouldn't want to load thousands of records in a single GridField :(

But if you're sure the number won't grow that far, I guess there's nothing against setting the number of items to 100 or 400 or...

$config = GridFieldConfig_RelationEditor::create(100); 


Community Member, 96 Posts

3 February 2014 at 3:00am

Thanks a lot, martimiz. This is what I've been looking for.
In my case it's unlikely to get more than 30 records, but for the usability it's better to see more records, otherwise you quickly overlook some records. Thanks again!