SilverStripe - limiting the number of many relations a dataobject can have

前端 未结 3 1519
别那么骄傲
别那么骄傲 2021-01-20 06:33

If I have a $has_many relationship that I want to manage with a GridField in the cms, how would I go about putting a limit on the number of how man

3条回答
  •  不思量自难忘°
    2021-01-20 07:11

    works for me: make the canCreate method of the DataObject that's managed by your GridField check for existing objects.

    of course, this doesn't allow you to implement a customg GridFieldComponent, as you need to modify the DataObject code.

提交回复
热议问题