From 32746c875c7acfae01ef0b9f63e3e70b0cec7c48 Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Thu, 10 May 2012 11:42:52 -0300 Subject: [PATCH] Accounts for GridFieldSortableHeader changing the sort --- code/forms/GridFieldSortableRows.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index f25fead..ef7ac48 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -60,6 +60,11 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP * @return {DataList} Modified Data List */ public function getManipulatedData(GridField $gridField, SS_List $dataList) { + $state=$gridField->State->GridFieldSortableHeader; + if ($state && !empty($state->SortColumn)) { + return $dataList; + } + return $dataList->sort($this->sortColumn); }