API: GridField field castings

28 views
Skip to first unread message

Tony Air

unread,
Nov 3, 2014, 6:15:17 AM11/3/14
to silverst...@googlegroups.com
I suggest to add an ability to pass casting method params to grid field.

This way for an instance:

$columns->setDisplayFields(array(
    'Photo.CroppedImage(100,100)' => 'Photo'
));

to do that we need to update GridFieldDataColumns > getValueFromRelation function I have fix to do it, but not sure if it will be accepted. 

Loz Calver

unread,
Nov 3, 2014, 6:34:22 AM11/3/14
to silverst...@googlegroups.com
Hi Tony,

We already have GridFieldDataColumns::setFieldCasting(), can that functionality handle this? I’m not sure of the specific syntax for it. Perhaps:

$columns-> setFieldCasting(array(
    'Photo' => array('Image->CroppedImage', 100, 100)
));


Loz

Tony Air

unread,
Nov 3, 2014, 6:45:59 AM11/3/14
to silverst...@googlegroups.com
Hi Loz, thx didn't knew about it
Reply all
Reply to author
Forward
0 new messages