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   352 Views

Avatar
Stephan

Community Member, 55 Posts

20 January 2014 at 1:32pm

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

Forum Moderator, 5513 Posts

20 January 2014 at 4:15pm

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

Community Member, 55 Posts

20 January 2014 at 10:13pm

Thanks very much :-)
Now it works!