src/Forms/GridFieldSortableRows.php
public function handleAction(GridField $gridField, $actionName, $arguments, $data)
    {
        $state = $gridField->State->GridFieldSortableRows;
        if (!is_bool($state->sortableToggle)) {
            $state->sortableToggle = false;
        } else if ($state->sortableToggle == true) {
            $gridField->getConfig()->removeComponentsByType(GridFieldFilterHeader::class);
            $gridField->getConfig()->removeComponentsByType(GridFieldSortableHeader::class);
        }


        if ($actionName == 'savegridrowsort') {
            return $this->saveGridRowSort($gridField, $data);
        } else if ($actionName == 'sorttopage') {
            return $this->sortToPage($gridField, $data);
        }
    }
public function handleAction(GridField $gridField, $actionName, $arguments, $data)
    {
        $state = $gridField->State->GridFieldSortableRows;
        if (!is_bool($state->sortableToggle)) {
            $state->sortableToggle = false;
        } else if ($state->sortableToggle == true) {
            $gridField->getConfig()->removeComponentsByType(GridFieldFilterHeader::class);
            $gridField->getConfig()->removeComponentsByType(GridFieldSortableHeader::class);
        }


        if ($actionName == 'savegridrowsort') {
            return $this->saveGridRowSort($gridField, $data);
        } else if ($actionName == 'sorttopage') {
            return $this->sortToPage($gridField, $data);
        }
    }
public function handleAction ( GridField $ gridField , $ actionName , $ arguments , $ data ) { $ state = $ gridField -> State -> GridFieldSortableRows ; if ( ! is_bool ( $ state -> sortableToggle ) ) { $ state -> sortableToggle = false ; } else if ( $ state -> sortableToggle == true ) { $ gridField -> getConfig ( ) -> removeComponentsByType ( GridFieldFilterHeader :: class ) ; $ gridField -> getConfig ( ) -> removeComponentsByType ( GridFieldSortableHeader :: class ) ; } if ( $ actionName == 'savegridrowsort' ) { return $ this -> saveGridRowSort ( $ gridField , $ data ) ; } else if ( $ actionName == 'sorttopage' ) { return $ this -> sortToPage ( $ gridField , $ data ) ; } }
Handle an action on the given grid field.
@param GridField $gridField Grid Field Reference
@param String $actionName Action identifier, see {@link getActions()}.
@param array $arguments Arguments relevant for this
@param array $data All form data
Handle an action on the given grid field .