20 October 2012 at 9:40pm
I am looking for the same thing. According to this http://www.silverstripe.org/general-questions/show/7395 it looks like there is no built-in function for you to edit the many_many_extraFields data.
I think there are 2 ways to get around this:
1. Break the many_many relation down to 2 has_many relations:
check the example here http://www.balbuss.com/multiple-many-many-s-of-the-same-class/
2. Write your own formfield
In my project, as it is too late to use Method 1, I have to write my own formfield so that it can be added back into the admin. I am using the SubmittedFormField in the UserForm module as an example to write my scripts.
It's a shame it is hard for us to do this when SS3 should have taken care of this.
I have seen the Datagrid proposal here http://open.silverstripe.org/wiki/development/DataGrid which is exactly what I want when I have large amount of data to manage. However, it looks like this proposal is ignored.
If you have any quick way to do this, please share.
24 October 2012 at 12:45am
I too stumbled upon this issue again, and I really feel that this option should either be implemented in a simple to use way (preferred :) ) or be removed entirely. I was thinking of posting this at the core dev group, to see what others think. Looks Like someone really should now...
29 January 2013 at 6:34am
I came accross the same issue yesterday. My problem is that I have a complex model where displaying the extra fields in getCMSFields is tricky. The context in which getCMSFields gets called varies, some extra fields may not be valid in some contexts. So I thought that the best place to display the extra form fields for my application is right in the gridfields list view. I made a very lightweight module and published it on github. In case anybody likes the idea of inline editing the extra fields in the gridfield, here it is:
13 February 2013 at 10:22am
avengex, do you know if its possible to change the form that shows up when clicking on the edit button in the grid, to only show all formfields for the many_many_extrafields.
I have about 7-8 many_many_extrafields. And clicking on edit should only allow me to edit these.
I dont want to make changes to all properties of the User class.
To manage users i already have a modeladmin.
The problem is, that my modeladmin uses getCMSFields() to generate the Form. And the edit button in the grid also uses getCMSFields(). Is there a way to detect if i am in the modeladmin section or if i clicked on edit in the many_many grid.
13 February 2013 at 11:28am
Yes, this is slightly off topic, but it's possible. In 2.4 you could pass in the $detailFormFields of the DataObjectManager, and in 3.1 you now call setFields on a GridFieldDetailForm, passing in a FieldList object.