Joe

(sorry you’re having trouble - couldn’t resist pointing out the in-character feelings)

Joe

> Finding it very depressing username and profile pic check out 🙂

👍 (1)
Joe

that’s why I hadn’t replied earlier - I have no experience with many_many_through

Joe

now that being said, instead of doing so, I could probably: • get the GridFieldDetailForm component • get the fields from it • insert my ManyMany field • set the fields on the GridFieldDetailForm to the updated FieldList

Joe
  1. $sponsorshipAddonsGridConfig = GridFieldConfig_RelationEditor::create();
  2.  
  3. $sponsorshipAddonsGridConfig->removeComponentsByType(new GridFieldDetailForm());
  4. $sponsorshipAddonsGridEditForm = new GridFieldDetailForm();
  5.  
  6. $sponsorshipAddonsGridEditForm->setFields(FieldList::create(
  7. ReadonlyField::create("Name"),
  8. CurrencyField::create("Price")->performReadonlyTransformation(),
  9. TextField::create('ManyMany[Quantity]', 'Quantity')
  10. ));
  11.  
  12. $sponsorshipAddonsGridConfig->addComponent($sponsorshipAddonsGridEditForm);
  13.  
  14. $sponsorshipTab->push(GridField::create(
  15. "SponsorshipAddons",
  16. "Sponsorship Addons",
  17. $this->SponsorshipAddons(),
  18. $sponsorshipAddonsGridConfig
  19. ));
Joe

so for a site I’ve done where I add an extraField to the detail form, I end up dropping the entire GridFieldDetailForm and adding a whole new one

Joe

if they do - report back so I know not to recommend that approach in the future lol

Joe

inb4 “gmail locked my account!” 😂