Permalink
Browse files

Sort order is now always fixed even if drag and drop toggle is not on

  • Loading branch information...
1 parent 2bf027e commit 0beef798a0cceb0e09dc6713f6507894c69466dd @UndefinedOffset committed Aug 10, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 code/forms/GridFieldSortableRows.php
@@ -89,6 +89,10 @@ public function getHTMLFragments($gridField) {
* @return DataList Modified Data List
*/
public function getManipulatedData(GridField $gridField, SS_List $dataList) {
+ //Detect and correct items with a sort column value of 0 (push to bottom)
+ $this->fixSortColumn($gridField, $dataList);
+
+
$headerState = $gridField->State->GridFieldSortableHeader;
$state = $gridField->State->GridFieldSortableRows;
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) {
@@ -101,10 +105,6 @@ public function getManipulatedData(GridField $gridField, SS_List $dataList) {
}
- //Detect and correct items with a sort column value of 0 (push to bottom)
- $this->fixSortColumn($gridField, $dataList);
-
-
return $dataList->sort($this->sortColumn);
}

0 comments on commit 0beef79

Please sign in to comment.