Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Drupal 7 views.module allows to refresh ajaxified views
  2. dynamically via a javascript call.
  3.  
  4. jQuery('.view-id-XXX').trigger('RefreshView');
  5.  
  6. // Implementation in PHP
  7.  
  8. $commands[] = ajax_command_invoke('.view-id-XXX', 'trigger', array('RefreshView'));
  9.  
  10. return array(
  11. '#type' => 'ajax',
  12. '#commands' => $commands,
  13. );
  14.  
  15. // OR
  16.  
  17. $commands[] = ajax_command_invoke('.view-id-XXX', 'trigger', array('RefreshView'));
  18.  
  19. ajax_deliver(array(
  20. '#type' => 'ajax',
  21. '#commands' => $commands,
  22. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement