function views_filters_selective_views_ajax_data_alter in Views Selective Filters 7
Implements hook_views_ajax_data_alter().
File
- ./
views_filters_selective.module, line 20 - Views Fiters Selective Module.
Code
function views_filters_selective_views_ajax_data_alter(&$commands, $view) {
// Only refresh if at least one of the filters is of type selective
// in order to minimize impact of any possible bug.
if (!empty($view->using_selective)) {
$exposed_block_plugin = $view->display_handler
->get_plugin('exposed_form');
// Generated as in views.module::views_exposed_form().
$block_id = drupal_clean_css_identifier('views_exposed_form-' . check_plain($view->name) . '-' . check_plain($view->display_handler->display->id));
$commands[] = ajax_command_replace('#' . $block_id, $exposed_block_plugin
->render_exposed_form(TRUE));
// To make submit work after ajax (https://drupal.org/node/2182885).
$commands[] = ajax_command_invoke(NULL, "attachBehaviors");
}
}