If you modify where the Exposed ajax form is nested in the DOM, it will currently break the Exposed Filter AJAX functionality of the View. This is caused by the use of "children()" on line 60 in ajax_view.js.:

  this.$exposed_form = this.$view.children('.view-filters').children('form');

It looks exactly two levels down which is not reliable as you may want to wrap your form or filters. This is what the jQuery page says about the children function:

"The .children() method differs from .find() in that .children() only travels a single level down the DOM tree while .find() can traverse down multiple levels to select descendant elements (grandchildren, etc.) as well."


As in my instance, I had wrapped my form in multiple divs to allow specific styling. However, this broke AJAX functionality. The attached patch solves this issue.

Members fund testing for the Drupal project. Drupal Association Learn more


jnpwebdeveloper’s picture

jnpwebdeveloper’s picture

Issue summary: View changes
Daniel Wentsch’s picture

I was just about to wonder why my AJAX view isn't Ajaxified anymore and started re-writing templates when I found your patch. Thanks and it would be lovely if this would get committed soon.

nedjo’s picture

Status: Active » Closed (duplicate)

Duplicate of #2425099: Exposed form in block with ajax no longer works, which has a similar patch.