Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » $summary_fields in modelAdmin (2.4)

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

Page: 1
Go to End
Author Topic: 353 Views
  • nekranox
    Avatar
    Community Member
    31 Posts

    $summary_fields in modelAdmin (2.4) Link to this post

    Hey guys,

    any ideas why my summary fields arent working? It's just displaying the default columns for the DataObject.

    class Customer extends DataObject {
       
       public static $db = array(
    [...]
       );
       
       public static $indexes = array(
          'Email' => 'unique'
       );
       
       public static $has_one = array(
          'CustomerGroup' => 'CustomerGroup'
       );
       
       public static $summary_fields = array(
          'Name' => 'Name',
          'Telephone' => 'Telephone',
          'Email' => 'Email',
          'Created' => 'CreatedText'
       );
       
       public static $casting = array("CreatedText" => "Text");
       
    public function CreatedText() {
    return $this->Created;
    }

    class crmAdmin extends ModelAdmin {

       public static $menu_title = 'Customer Relationship Manager';
       public static $url_segment = 'crm';
       public static $managed_models = 'CustomerGroup';

    [...]

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: $summary_fields in modelAdmin (2.4) Link to this post

    Your managing the 'CustomerGroup' class but your object classname is Customer?

    353 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.