function hook_views_ajax_data_alter

cis7 views.api.php hook_views_ajax_data_alter(&$commands, $view)
cle7 views.api.php hook_views_ajax_data_alter(&$commands, $view)
elmsmedia7 views.api.php hook_views_ajax_data_alter(&$commands, $view)
icor7 views.api.php hook_views_ajax_data_alter(&$commands, $view)
meedjum_blog7 views.api.php hook_views_ajax_data_alter(&$commands, $view)
mooc7 views.api.php hook_views_ajax_data_alter(&$commands, $view)

This hook allows to alter the commands which are used on a views ajax request.

Parameters

$commands: An array of ajax commands

$view view: The view which is requested.

Related topics

1 invocation of hook_views_ajax_data_alter()
views_ajax in sites/all/modules/ulmus/views/includes/ajax.inc
Menu callback to load a view via AJAX.

File

sites/all/modules/ulmus/views/views.api.php, line 1078
Describe hooks provided by the Views module.

Code

function hook_views_ajax_data_alter(&$commands, $view) {
  // Replace Views' method for scrolling to the top of the element with your
  // custom scrolling method.
  foreach ($commands as &$command) {
    if ($command['method'] == 'viewsScrollTop') {
      $command['method'] .= 'myScrollTop';
    }
  }
}