MINOR: Not GridField need to show for an new Company object before it's saved to DB.

This commit is contained in:
Normann Lou 2012-03-13 17:34:37 +13:00
parent a360865b47
commit b6401c2386

View File

@ -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;
}