mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Initial sorting equals sortColumn
After a user has changed sorting order of objects in the list, and when drag&drop is disabled, sorting is made by $default_sort from that DataObjects property or default set by SS. This results in different sorting when checkbox is enabled or disabled what confuses users. This change always sorts the list by $sortColumn, so that user always sees same sorting.
This commit is contained in:
parent
86d08f9757
commit
3dfe104b53
@ -99,7 +99,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;
|
||||
return $dataList->sort($this->sortColumn);
|
||||
}
|
||||
|
||||
if ($state->sortableToggle == true) {
|
||||
|
Loading…
Reference in New Issue
Block a user