public function TaxonomyViewsIntegratorSettingsForm::loadDisplayOptions in Taxonomy Views Integrator 8
Ajax callback - null the value and return the piece of the form.
The value gets nulled because we cannot overwrite #default_value in an ajax callback.
Parameters
array $form: Ajax form render array.
\Drupal\Core\Form\FormStateInterface $form_state: Submitted form state.
Return value
array Form render array response.
See also
https://www.drupal.org/node/1446510
https://www.drupal.org/node/752056
File
- src/
Form/ TaxonomyViewsIntegratorSettingsForm.php, line 240
Class
- TaxonomyViewsIntegratorSettingsForm
- TVI global settings form.
Namespace
Drupal\tvi\FormCode
public function loadDisplayOptions(array &$form, FormStateInterface $form_state) {
$form['tvi']['view_display']['#value'] = '';
$form_state
->setRebuild();
return $form;
}