Hi there, I've been playing around with GridField in SS3 and found a problem I'm not sure how to address.
I have the following model : 'Page' -- has_one --> 'Block' --has_many--> 'Contents'
I can successfully add a gridfield to manage the 'Page' -- has_one --> 'Block' relationship but as soon as I add the second 'Block' --has_many--> 'Contents' Relationship I get this error:
Error at \framework\forms\gridfield\GridField.php line 291: Uncaught LogicException: GridField HTML fragment 'buttons-before-left' was given content, but not defined. Perhaps there is a supporting GridField component you need to add?
Now I can get around that error by adding a $DefineFragment(buttons-before-left) somewhere in one of the GridField templates Eg \framework\templates\Includes\GridFieldToolbarHeader.ss It seesm to be adding the 'autocompleter' section.
Then it works well.... but this is obviously a slightly hacky way to do things - is there a better one? Have I just missed the correct procedure?
Sorry not an answer, but I do have a question.. you say that you have a working has_one relation managed via GridField. Would you mind sharing that code as I am struggling to find references to this setup anywhere, its all 1-many and many-many.
18 July 2012 at 10:34am
NB I belive the previous problem has been addressed since I posted last!
but a has one i've mostly managed with a dropdown field (I can't recall my original setup unfortunately) but if you really wanted i guess you could use something like this:
untested so mileage may vary...