You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function getManipulatedData, I moved the call to fixSortColumn to the front, because it doen't always run properly otherwise.
No idea if this is the best solution, though.
/**
* Manipulate the datalist as needed by this grid modifier.
* @param GridField $gridField Grid Field Reference
* @param SS_List $dataList Data List to adjust
* @return DataList Modified Data List
*/
public function getManipulatedData(GridField $gridField, SS_List $dataList) {
$this->fixSortColumn($gridField, $dataList);
$headerState = $gridField->State->GridFieldSortableHeader;
$state = $gridField->State->GridFieldSortableRows;
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) {
return $dataList;
}
if ($state->sortableToggle == true) {
$gridField->getConfig()->removeComponentsByType('GridFieldFilterHeader');
$gridField->getConfig()->removeComponentsByType('GridFieldSortableHeader');
}
//Detect and correct items with a sort column value of 0 (push to bottom)
return $dataList->sort($this->sortColumn);
}
The text was updated successfully, but these errors were encountered:
In the function getManipulatedData, I moved the call to fixSortColumn to the front, because it doen't always run properly otherwise.
No idea if this is the best solution, though.
The text was updated successfully, but these errors were encountered: