ENHANCEMENT: use GridfieldConfig_RelationEditor for manymany relationships
When managing manymany Relations using
GridFieldConfig_RelationEditor::create()
instead of
GridFieldConfig_RecordEditor::create()
would be great.
In the meanwhile this works as a workaround:
public function getCMSFields() {
$fields = $this->getGeneratedCMSFields();
$gridConf = GridFieldConfig_RelationEditor::create();
$fields->dataFieldByName('MyManyManyRelationship')->setConfig($gridConf);
return $fields;
}
But out of the box it's really nicer ;)
Cool idea! What does RelationEditor do, exactly?
aaron_carlino: { webdeveloper, www.leftandmain.com }
On Tuesday, April 9, 2013 at 9:35 AM, wernerkrauss wrote:
In the meanwhile this works as a workaround: public function getCMSFields() { $fields = $this->getGeneratedCMSFields(); $gridConf = GridFieldConfig_RelationEditor::create(); $fields->dataFieldByName('MyManyManyRelationship')->setConfig($gridConf); return $fields; }
But out of the box it's really nicer ;)
— Reply to this email directly or view it on GitHub (https://github.com/unclecheese/SilverSmith/issues/10#issuecomment-16112634).
Hi unclecheese,
according to http://doc.silverstripe.org/framework/en/reference/grid-field#gridfieldconfig-relationeditor it adds an interface for linking existing dataobjects to a manymany relationship or unlink them. It's just some more features than RecordEditor.
I had also to tweak the searchable_fields of the DO to overcome the "Title:StartsWidth" search which is IMHO a limitation.