1

I have a View showing a list of nodes that has a block display, with AJAX enabled. It seems that that is required when you using exposed filters on a block display in 8.

What I want to do is autosubmit the form (where did this option go?) when a filter is changed. This is the jQuery I have tried:

    $('select[data-drupal-selector="edit-field-article-category"]', context).change(function() {
      $('input[name="sort_by"]').attr('value', 'created');
      $('form#views-exposed-form-blog-blog-listing input[data-drupal-selector="edit-submit-blog"]').trigger('click');
    });

    $('select[data-drupal-selector="edit-field-article-category"]', context).change(function() {
      $('input[name="sort_by"]').attr('value', 'created');
      $('form#views-exposed-form-blog-blog-listing').trigger('submit');
    });

    $('select[data-drupal-selector="edit-field-article-category"]', context).change(function() {
      $('input[name="sort_by"]').attr('value', 'created');
      $('form#views-exposed-form-blog-blog-listing').submit();
    });

In the first case, nothing happens. In the latter cases, the page reloads with the query string attached. Nothing in the view is filtered.

What am I missing?

  • Maybe try submitting like this $('#button-id')[0].click(); – No Sssweat May 25 '17 at 7:55
1

Was there a while ago, still don't understand why they'd scrap-off such an essential feature. Thanks to this thread @ drupal , found a solution.

Download the module at #5

  • There is a patch to #5 in #13, but if you keep reading other comments seems like this module doesn't work in the views preview. – No Sssweat May 25 '17 at 8:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.