When using views without Ajax, it’s easy to access the $view->result array using hook_views_pre_render(). But how can I access the $view object if I’m using Ajax to filter my view?
I want to use to result in different Javascripts and forms, therefore the best solution would be to put $view->result in the Drupal.settings object.
Is this possible? I’ve found hook_ajax_data_alter() but I don’t know how to use it, or if it’s the right way to go.
Thanks!
Ok, so I’ve found a somewhat good looking solution.
I’ve simply added the $view->result to the $object, and added my custom callback, which adds $view->result to the Drupal.settings object.
I tried to add a callback directly to the $view object, but didn’t succeed, so this will do for now.
Please let me know if there’s a better way to do this =)