Hello,
I have a DataObject like this:
class MyDataObject extends DataObject {
private static $db = array( ... );
private static $many_many = array(
'Members' => 'Member'
);
}
I manage MyDataObject with ModelAdmin. No problem.
I've make an extension:
class MyDataObjectRole extends DataExtension {
private static $db = array( ... );
private static $belongs_many_many = array(
'MyDataObjects' => 'MyDataObject'
);
public function updateCMSFields(FieldList $fields) {
$fields->removeByName('MyDataObjects');
$mydataobjects = MyDataObject::get()->map('ID', ... );
$mydataobjectfield = new ListboxField('MyDataObjects', 'MyDataObjects', $mydataobjects);
$mydataobjectfield->setMultiple(true);
$fields->addFieldToTab('Root.Main', $mydataobjectfield);
return $fields;
}
}
And i use it:
---
Name: extensions
---
Member:
extensions:
['MyDataObjectRole']
In my admin Member form, i see the ListboxField and it works. OK.
But i would like to append a button like GridFieldAddNewButton after my ListbofField to facilitate new MyDataObject creation without going to ModelAdmin.
And i'm lost :)
Somebody can help me ? Thanks