From b031188080484af89a0c03e6158bb8be4faf152e Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sat, 27 Oct 2012 11:30:26 +1300 Subject: [PATCH] Updated gridfield docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes GridFieldConfig_RelationEditor example (was the same as RecordEditor) and fixes related links. --- docs/en/topics/grid-field.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/en/topics/grid-field.md b/docs/en/topics/grid-field.md index 46b415571..465786a1e 100644 --- a/docs/en/topics/grid-field.md +++ b/docs/en/topics/grid-field.md @@ -133,16 +133,17 @@ The fields displayed in the edit form are from `DataObject::getCMSFields()` ### GridFieldConfig_RelationEditor Similar to `GridFieldConfig_RecordEditor`, but adds features to work on a record's has-many or -many-many relationships. +many-many relationships. As such, it expects the list used with the `GridField` to be a +`RelationList`. That is, the list returned by a has-many or many-many getter. The relations can be: - Searched for existing records and add a relationship - Detach records from the relationship (rather than removing them from the database) -- Create new related records and automatically add the relationship. +- Create new related records and automatically add them to the relationship. :::php - $gridField = new GridField('pages', 'All pages', SiteTree::get(), GridFieldConfig_RecordEditor::create()); + $gridField = new GridField('images', 'Linked images', $this->Images(), GridFieldConfig_RelationEditor::create()); The fields displayed in the edit form are from `DataObject::getCMSFields()` @@ -259,5 +260,5 @@ A GridFieldComponent sets and gets data from the GridState. ## Related - * [/reference/modeladmin](ModelAdmin: A UI driven by GridField) - * [/tutorials/5-dataobject-relationship-management](Tutorial 5: Dataobject Relationship Management) \ No newline at end of file + * [ModelAdmin: A UI driven by GridField](/reference/modeladmin) + * [Tutorial 5: Dataobject Relationship Management](/tutorials/5-dataobject-relationship-management) \ No newline at end of file