Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a title for the sort column with $summary_fields

Tags:

silverstripe

I want to set a column title for the sort column (in $summary_fields) for a GridField.

I can't seem to do something like:

static $summary_fields = array('Reorder' => 'Sort');

Although I can use the $summary_fields method to change the order of the columns, I can't use it to set a title for the sort column.

I am using the GridFieldOrderableRows component from the SilverStripe Grid Field Extensions Module.

GridField column title screenshot example

like image 450
helenclarko Avatar asked Jul 17 '16 22:07

helenclarko


1 Answers

This is now possible. We can set the column heading by setting the Reorder label in the $field_labels variable:

private static $field_labels = array(
    'Reorder' => 'Sort'
);
like image 152
3dgoo Avatar answered Sep 22 '22 14:09

3dgoo