From 8590bec1a9ec994aff93c4ed6898cf2fc7bf5b70 Mon Sep 17 00:00:00 2001 From: ARNHOE Date: Fri, 30 Nov 2012 09:53:01 +0100 Subject: [PATCH] SummaryFields doesn't change Title of Field $field_labels does for me. --- docs/en/reference/modeladmin.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/en/reference/modeladmin.md b/docs/en/reference/modeladmin.md index fda699538..a92d69729 100644 --- a/docs/en/reference/modeladmin.md +++ b/docs/en/reference/modeladmin.md @@ -72,14 +72,17 @@ for the search form, override `[api:DataObject->getCustomSearchContext()]` on yo The results are shown in a tabular listing, powered by the `[GridField](/reference/grid-field)`, more specifically the `[api:GridFieldDataColumns]` component. It looks for a `[api:DataObject::$summary_fields]` static on your model class, -where you can add or remove columns, or change their title. +where you can add or remove columns. To change the title, use `[api:DataObject::$field_labels]`. :::php class Product extends DataObject { // ... + static $field_labels = array( + 'Price' => 'Cost' // renames the column to "Cost" + ); static $summary_fields = array( - 'Name' => 'Name', - 'Price' => 'Cost', // renames the column to "Cost" + 'Name', + 'Price', // leaves out the 'ProductCode' field, removing the column ); }