mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Fixed issue where the headers could be missing even when sorting is off
Fixed issue where the sort direction would not apply when sorting using the headers
This commit is contained in:
parent
9acc93b361
commit
94e916b4d9
@ -1,5 +1,8 @@
|
||||
# Change Log
|
||||
|
||||
## [0.6.5](https://github.com/UndefinedOffset/SortableGridField/tree/0.6.5) (2016-11-24)
|
||||
[Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/0.6.4...0.6.5)
|
||||
|
||||
## [0.6.4](https://github.com/UndefinedOffset/SortableGridField/tree/0.6.4) (2016-11-22)
|
||||
[Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/0.6.3...0.6.4)
|
||||
|
||||
|
@ -118,11 +118,12 @@ 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) && (is_string($headerState->SortColumn) || is_array($headerState->SortColumn))) {
|
||||
return $dataList->sort($headerState->SortColumn);
|
||||
if ((!is_bool($state->sortableToggle) || $state->sortableToggle===false) && $headerState && is_string($headerState->SortColumn) && is_string($headerState->SortDirection)) {
|
||||
return $dataList->sort($headerState->SortColumn, $headerState->SortDirection);
|
||||
}
|
||||
|
||||
if ($state->sortableToggle == true) {
|
||||
//var_dump($state->sortableToggle);exit;
|
||||
if ($state->sortableToggle === true) {
|
||||
$gridField->getConfig()->removeComponentsByType('GridFieldFilterHeader');
|
||||
$gridField->getConfig()->removeComponentsByType('GridFieldSortableHeader');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user