3373 Posts in 998 Topics by 712 members
|Go to End|
31 March 2010 at 5:16pm
I would like to organise persons and countries, which are both DataObjects, with modeladmin. One person is eligible to work in many countries and countries relate to many persons eligible to work in it.
In the CMS I add eligibility countries with a dropdownfield in person class getCMSFields() to the many_many relation.
To list all countries a person is eligible to work with tablelistfield in the CMS works fine. But my problem is to delete a row in the table. I tried to delete rows in the tablelistfield with the delete permission. Unfortunately the country object will be deleted and not just the relation between person and country.
Does anybody know how to delete just the relation with a button or link in the tablelistfield??
1 April 2010 at 2:29am
With the method getCMSFields_forPopup() you can define how your popup field for a single entry in the ComplexTableField looks like. I would display the country as a CheckboxSetField.
This tutorial can help: http://doc.silverstripe.org/doku.php?id=tutorial:5-dataobject-relationship-management&s=getcmsfields%20forpopup
|Go to Top|