It would be useful to enable extension of JSON data returns.

One use case is solving common problems, e.g., ensuring that any CSS and JS files and settings data needed by the new content being loaded but not already loaded on the page are loaded and properly handled.

Views module recently introduced (http://drupal.org/node/115949) a new alter hook for this purpose, hook_ajax_data_alter(), to allow extending of AJAX data returned and also the specification of additional JS callbacks for the data to be passed.

For a sample module implementing this hook, see the ajax_load module attached to this comment:

http://drupal.org/node/115949#comment-782620

With this general approach, we can use a common solution rather than having to implement a separate solution in each AJAX module.

Comments

sun’s picture

Status: Active » Closed (duplicate)

I think this has been solved: In addition to the new AJAX framework, we also made sure that there's an alter: http://api.drupal.org/api/function/ajax_render/7