src/Forms/GridField/GridFieldAddExistingAutocompleter.php
public function handleAction(GridField $gridField, $actionName, $arguments, $data)
    {
        switch ($actionName) {
            case 'addto':
                if (isset($data['relationID']) && $data['relationID']) {
                    $gridField->State->GridFieldAddRelation = $data['relationID'];
                }
                break;
        }
    }
public function handleAction(GridField $gridField, $actionName, $arguments, $data)
    {
        switch ($actionName) {
            case 'addto':
                if (isset($data['relationID']) && $data['relationID']) {
                    $gridField->State->GridFieldAddRelation = $data['relationID'];
                }
                break;
        }
    }
public function handleAction ( GridField $ gridField , $ actionName , $ arguments , $ data ) { switch ( $ actionName ) { case 'addto' : if ( isset ( $ data [ 'relationID' ] ) && $ data [ 'relationID' ] ) { $ gridField -> State -> GridFieldAddRelation = $ data [ 'relationID' ] ; } break ; } }
Manipulate the state to add a new relation

@param GridField $gridField
@param string $actionName Action identifier, see {@link getActions()}.
@param array $arguments Arguments relevant for this
@param array $data All form data
Manipulate the state to add a new relation