function ViewEditForm::rebuildCurrentTab

Same name and namespace in other branches
  1. 9 core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::rebuildCurrentTab()
  2. 10 core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::rebuildCurrentTab()
  3. 11.x core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::rebuildCurrentTab()

Regenerate the current tab for AJAX updates.

Parameters

\Drupal\views_ui\ViewUI $view: The view to regenerate its tab.

\Drupal\Core\Ajax\AjaxResponse $response: The response object to add new commands to.

string $display_id: The display ID of the tab to regenerate.

File

core/modules/views_ui/src/ViewEditForm.php, line 681

Class

ViewEditForm
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

public function rebuildCurrentTab(ViewUI $view, AjaxResponse $response, $display_id) {
    $this->displayID = $display_id;
    if (!$view->getExecutable()
        ->setDisplay('default')) {
        return;
    }
    // Regenerate the main display area.
    $build = $this->getDisplayTab($view);
    $response->addCommand(new HtmlCommand('#views-tab-' . $display_id, $build));
    // Regenerate the top area so changes to display names and order will appear.
    $build = $this->renderDisplayTop($view);
    $response->addCommand(new ReplaceCommand('#views-display-top', $build));
}

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