Skip to content

Commit

Permalink
Sort order is now always fixed even if drag and drop toggle is not on
Browse files Browse the repository at this point in the history
  • Loading branch information
UndefinedOffset committed Aug 10, 2012
1 parent 2bf027e commit 0beef79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/forms/GridFieldSortableRows.php
Expand Up @@ -89,6 +89,10 @@ public function getHTMLFragments($gridField) {
* @return DataList Modified Data List * @return DataList Modified Data List
*/ */
public function getManipulatedData(GridField $gridField, SS_List $dataList) { 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; $headerState = $gridField->State->GridFieldSortableHeader;
$state = $gridField->State->GridFieldSortableRows; $state = $gridField->State->GridFieldSortableRows;
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) { if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) {
Expand All @@ -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); return $dataList->sort($this->sortColumn);
} }


Expand Down

0 comments on commit 0beef79

Please sign in to comment.