21298 Posts in 5735 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 158 Views |
-
customsiteconfig and gridfield

10 February 2013 at 1:22am
Hi,
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(
'Mitarbeiter',
'Mitarbeiter',
$this->owner->Mitarbeiter(),
GridFieldConfig_RelationEditor::create()
);Can anybody help?
-
Re: customsiteconfig and gridfield

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.
-
Re: customsiteconfig and gridfield

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?
| 158 Views | ||
|
Page:
1
|
Go to Top |


