I have a View of users with some fields and some exposed filters. By default on the modal window of this module (see attached img) I get all the selected fields and the exposed filters as expected, plus an "Apply" a "Reset" and a "Submit" button. All buttons are working perfect except the "Reset" button, any ideas/suggestions why it's not working?
Note that in the Views preview is working fine, but elsewhere not, actually it redirects to the front page.
I don't know where should I start the debugging.

Perhaps this is a similar issue to this one Reset button but this is an issue for another version that not applies to this version.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emmc created an issue. See original summary.

mchar’s picture

Issue summary: View changes
mchar’s picture

Any clues ?

carolpettirossi’s picture

This issue is still happenning. Any workaround to solve this?

carolpettirossi’s picture

I've found a workaround to reset button: https://www.drupal.org/node/1109980#comment-8613897

(function ($) {
  $(document).delegate('.views-reset-button .form-submit','click',function(event) {
    event.preventDefault();
    $('form').each(function() {
      $('form select option').removeAttr('selected');
      $('form input[type=text]').attr('value', '');
      this.reset();
    }); 
    $('.views-submit-button .form-submit').click();
    return false;
  }); 
}(jQuery));
carolpettirossi’s picture

Please,

Review the patch and apply (if it's ok) in the next release.

Thank you.

mchar’s picture

This patch seems to work for my case (described on top) and hope the same for all other cases, thank you!

ashzade’s picture

Patch worked for me as well. Thank you!

kenorb’s picture

Status: Active » Needs review
xadag’s picture

Hi,

There is a bug in this patch, all jquery selectors are to large and i had issues about other form in modal (like linkit).

I fixe that by using :

   // Make Reset button works on modal window.
      $(document).delegate('form[id^="views-exposed-form-entity-reference-entityreference-view-widget"] .views-reset-button .form-submit','click',function(event) {
        event.preventDefault();
        $(this).parents('form').each(function() {
          $(this).find('select option').removeAttr('selected');
          $(this).find('input[type=text]').attr('value', '');
          this.reset();
          $(this).find('input[type=submit]').click();
        });
        return false;
      });