mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
MINOR: Not GridField need to show for an new Company object before it's saved to DB.
This commit is contained in:
parent
a360865b47
commit
b6401c2386
@ -36,11 +36,11 @@ class Company extends DataObject {
|
||||
$fields->add(new TextField('Category', 'Category', $this->Category));
|
||||
$fields->add(new TextField('Revenue', 'Revenue', $this->Revenue));
|
||||
$fields->add(new TextField('CEO', 'CEO', $this->CEO));
|
||||
|
||||
$config = new GridFieldConfig_RelationEditor();
|
||||
|
||||
$gridField = new GridField('Employees', 'Employees', $this->Employees(), $config);
|
||||
$fields->add($gridField);
|
||||
if($this->ID !== 0){//existing
|
||||
$config = new GridFieldConfig_RelationEditor();
|
||||
$gridField = new GridField('Employees', 'Employees', $this->Employees(), $config);
|
||||
$fields->add($gridField);
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user