Regenerate the current tab for AJAX updates.
\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.
public function rebuildCurrentTab(ViewUI $view, AjaxResponse $response, $display_id) {
$this->displayID = $display_id;
if (!$view
->get('executable')
->setDisplay('default')) {
return;
}
// Regenerate the main display area.
$build = $this
->getDisplayTab($view);
static::addMicroweights($build);
$response
->addCommand(new HtmlCommand('#views-tab-' . $display_id, drupal_render($build)));
// Regenerate the top area so changes to display names and order will appear.
$build = $this
->renderDisplayTop($view);
static::addMicroweights($build);
$response
->addCommand(new ReplaceCommand('#views-display-top', drupal_render($build)));
}