Use Sort of GridField Header (#96)

When not in 'Drag&Drop reordering' mode ('sortableToggle' is false) and a SortColumn is set by GridField's header, this last one should be used; otherwise, when the user clicks on a sortable header, the list is reloaded and the header shows a up/down sorting arrow, but this doesn't reflect the actual sorting.
This commit is contained in:
Matthias Schelling 2016-11-18 19:13:54 +01:00 committed by Ed Chipman
parent bc38ff5693
commit d3cfda5fe1
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
$headerState = $gridField->State->GridFieldSortableHeader;
$state = $gridField->State->GridFieldSortableRows;
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) {
return $dataList->sort($this->sortColumn);
return $dataList->sort($headerState->SortColumn);
}
if ($state->sortableToggle == true) {
@ -676,4 +676,4 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
}
}
}
?>
?>