Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » [SOLVED] SS 3: set custom column in GridField

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 309 Views
  • Stephan
    Avatar
    Community Member
    55 Posts

    [SOLVED] SS 3: set custom column in GridField Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: [SOLVED] SS 3: set custom column in GridField Link to this post

    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.

  • Stephan
    Avatar
    Community Member
    55 Posts

    Re: [SOLVED] SS 3: set custom column in GridField Link to this post

    Thanks very much
    Now it works!

    309 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.