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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

customsiteconfig and gridfield

Go to End

3 Posts   1523 Views


Community Member, 173 Posts

10 February 2013 at 1:22am

can anybody explain, how to use the gridfield within a custom siteconfig?

The following will throw an error (PHP Fatal error: Call to undefined method CustomSiteConfig::Mitarbeiter()):

			$mitarbeiterField = new GridField(

Can anybody help?


Community Member, 173 Posts

10 February 2013 at 3:11am

Hi, got it working by myself:

	$mitarbeiterFieldConfig = GridFieldConfig::create()->addComponents(
			  new GridFieldToolbarHeader(),
			  new GridFieldAddNewButton('toolbar-header-right'),
			  new GridFieldSortableHeader(),
			  new GridFieldDataColumns(),
			  new GridFieldPaginator(10),
			  new GridFieldEditButton(),
			  new GridFieldDeleteAction(),
			  new GridFieldDetailForm(),
			  new GridFieldSortableRows('SortOrder')
			$mitarbeiterField = new GridField('Mitarbeiter', 'Mitarbeiterliste', new DataList('Mitarbeiter'), $mitarbeiterFieldConfig);
			$fields->addFieldToTab('Root.Mitarbeiter', $mitarbeiterField);

greetings, carsten.


Community Member, 5 Posts

18 February 2013 at 12:35pm

I have been having the same issue and have tried applying the changes you made with no success.

Which part of your changes in particular fixed the issue?

Anyone else have any experience using GridField in a SiteConfig extension?