Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

[SOLVED] SS 3: set custom column in GridField


Reply

3 Posts   320 Views

Avatar
Stephan

20 January 2014 at 1:32pm Community Member, 55 Posts

Hi experts,
I want to show a custom generated content of a column in my GridField.
The content has to be the result of a query of another model but depending on the value of another column in the same GridField.
I know that this is solved normally with relations, but I can't use this in this case, because the value is not related to the ID.

How can I achieve this?

TIA Stephan

Avatar
Willr

20 January 2014 at 4:15pm Forum Moderator, 5511 Posts

Simply add a new field name in summary_fields and a method of the same name to your model. GridField will handle calling the method.

Avatar
Stephan

20 January 2014 at 10:13pm Community Member, 55 Posts

Thanks very much :-)
Now it works!