Merge pull request #188 from phalkunz/7601-listview-sort-by-title

Enable page sorting by Page name in list view (see #7601)
This commit is contained in:
Ingo Schommer 2012-08-29 05:42:07 -07:00
commit ab0dce9127

View File

@ -702,6 +702,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
'Created' => _t('SiteTree.CREATED', 'Date Created'), 'Created' => _t('SiteTree.CREATED', 'Date Created'),
'LastEdited' => _t('SiteTree.LASTUPDATED', 'Last Updated'), 'LastEdited' => _t('SiteTree.LASTUPDATED', 'Last Updated'),
); );
$gridField->getConfig()->getComponentByType('GridFieldSortableHeader')->setFieldSorting(array('getTreeTitle' => 'Title'));
if(!$params) { if(!$params) {
$fields = array_merge(array('listChildrenLink' => ''), $fields); $fields = array_merge(array('listChildrenLink' => ''), $fields);