mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-06-22 04:19:19 +02:00
Sort order is now always fixed even if drag and drop toggle is not on
This commit is contained in:
parent
2bf027e5f0
commit
0beef798a0
|
@ -89,6 +89,10 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||
* @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 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||
}
|
||||
|
||||
|
||||
//Detect and correct items with a sort column value of 0 (push to bottom)
|
||||
$this->fixSortColumn($gridField, $dataList);
|
||||
|
||||
|
||||
return $dataList->sort($this->sortColumn);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user