You are here

public function WebformTableTrait::getElementSelectorSourceValues in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElement/WebformTableTrait.php \Drupal\webform\Plugin\WebformElement\WebformTableTrait::getElementSelectorSourceValues()

File

src/Plugin/WebformElement/WebformTableTrait.php, line 117

Class

WebformTableTrait
Provides a 'table' trait.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function getElementSelectorSourceValues(array $element) {
  if ($this
    ->hasMultipleValues($element)) {
    return [];
  }
  $name = $element['#webform_key'];
  $options = OptGroup::flattenOptions($element['#options']);
  return [
    ":input[name=\"{$name}\"]" => $options,
  ];
}