function ListItemBase::deleteAjax

Same name in other branches
  1. 10 core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php \Drupal\options\Plugin\Field\FieldType\ListItemBase::deleteAjax()

Ajax callback for per row delete button.

File

core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php, line 322

Class

ListItemBase
Plugin base class inherited by the options field types.

Namespace

Drupal\options\Plugin\Field\FieldType

Code

public static function deleteAjax(array $form, FormStateInterface $form_state) {
    $button = $form_state->getTriggeringElement();
    return NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -3));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.