From 8aa60c207fbf3e8371c8675b440ebb1628387bbf Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Fri, 9 Mar 2012 12:53:27 +1300 Subject: [PATCH] API CHANGE: Renaming of gridfield components #6921 --- code/Company.php | 6 +++--- code/GridFieldTestPage.php | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/code/Company.php b/code/Company.php index b217e92..36e7589 100644 --- a/code/Company.php +++ b/code/Company.php @@ -38,13 +38,13 @@ class Company extends DataObject { $fields->add(new TextField('CEO', 'CEO', $this->CEO)); $config = new GridFieldConfig(); - $config->addComponent(new GridFieldRelationAdd('Name')); + $config->addComponent(new GridFieldAddExistingAutocompleter('Name')); $config->addComponent(new GridFieldDefaultColumns()); $config->addComponent(new GridFieldSortableHeader()); $config->addComponent(new GridFieldPaginator()); $config->addComponent(new GridFieldDeleteAction()); - $config->addComponent(new GridFieldRelationDelete()); - $config->addComponent(new GridFieldPopupForms()); + $config->addComponent(new GridFieldRemoveButton()); + $config->addComponent(new GridFieldDetailForm()); $gridField = new GridField('Employees', 'Employees', $this->Employees(), $config); $fields->add($gridField); diff --git a/code/GridFieldTestPage.php b/code/GridFieldTestPage.php index f583deb..a76d90d 100644 --- a/code/GridFieldTestPage.php +++ b/code/GridFieldTestPage.php @@ -35,10 +35,10 @@ class GridFieldTestPage extends Page { $config->addComponent(new GridFieldDefaultColumns()); $config->addComponent(new GridFieldSortableHeader()); $config->addComponent(new GridFieldPaginator); - $config->addComponent(new GridFieldFilter()); + $config->addComponent(new GridFieldFilterHeader()); $config->addComponent(new GridFieldDeleteAction()); - $config->addComponent(new GridFieldEditAction()); - $config->addComponent($forms = new GridFieldPopupForms()); + $config->addComponent(new GridFieldEditButton()); + $config->addComponent($forms = new GridFieldDetailForm()); $grid = new GridField('Companies', 'Companies', new DataList('Company'),$config); $fields->addFieldToTab('Root.NoRelation', $grid); @@ -46,10 +46,10 @@ class GridFieldTestPage extends Page { $config->addComponent(new GridFieldDefaultColumns()); $config->addComponent(new GridFieldSortableHeader()); $config->addComponent(new GridFieldPaginator); - $config->addComponent(new GridFieldFilter()); + $config->addComponent(new GridFieldFilterHeader()); $config->addComponent(new GridFieldDeleteAction()); - $config->addComponent(new GridFieldEditAction()); - $config->addComponent(new GridFieldRelationAdd('Name')); + $config->addComponent(new GridFieldEditButton()); + $config->addComponent(new GridFieldAddExistingAutocompleter('Name')); $grid = new GridField('HasManyCompanies', 'HasManyCompanies', new DataList('Company'),$config); $fields->addFieldToTab('Root.HasMany', $grid); @@ -57,10 +57,10 @@ class GridFieldTestPage extends Page { $config->addComponent(new GridFieldDefaultColumns()); $config->addComponent(new GridFieldSortableHeader()); $config->addComponent(new GridFieldPaginator); - $config->addComponent(new GridFieldFilter()); + $config->addComponent(new GridFieldFilterHeader()); $config->addComponent(new GridFieldDeleteAction()); - $config->addComponent(new GridFieldEditAction()); - $config->addComponent(new GridFieldRelationAdd('Name')); + $config->addComponent(new GridFieldEditButton()); + $config->addComponent(new GridFieldAddExistingAutocompleter('Name')); $grid = new GridField('ManyManyCompanies', 'ManyManyCompanies', new DataList('Company'),$config); $fields->addFieldToTab('Root.ManyMany', $grid); @@ -90,10 +90,10 @@ class GridFieldTestPage_Controller extends Page_Controller { $config->addComponent(new GridFieldDefaultColumns()); $config->addComponent(new GridFieldSortableHeader()); $config->addComponent(new GridFieldPaginator); - $config->addComponent(new GridFieldFilter()); + $config->addComponent(new GridFieldFilterHeader()); $config->addComponent(new GridFieldDeleteAction()); - $config->addComponent(new GridFieldEditAction()); - $config->addComponent(new GridFieldPopupForms()); + $config->addComponent(new GridFieldEditButton()); + $config->addComponent(new GridFieldDetailForm()); $grid = new GridField('Companies', 'Companies', new DataList('Company'),$config); return new Form($this,'Form',new FieldList($grid),new FieldList());