mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
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:
parent
bc38ff5693
commit
d3cfda5fe1
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user