Exposed filter ajax calling other entire ajax?

by Logeshvaran   Last Updated August 13, 2019 06:07 AM - source

I have used the below code from this URL. Run callback after Views exposed filter AJAX .

(function($, Drupal, drupalSettings) {

  Drupal.behaviors.myModuleScript = {

    attach: function(context, settings) {
      // Attach action to Drupal Ajax Views event
      $(document).once('weberAjaxViews').ajaxSuccess(function (event, data) {
        if (drupalSettings && drupalSettings.views && drupalSettings.views.ajaxViews) {

          var ajaxViews = drupalSettings.views.ajaxViews;
          Object.keys(ajaxViews || {}).forEach(function (i) {
            if (ajaxViews[i]['view_name'] == 'your_view_name' &&  ajaxViews[i]['view_display_id'] == 'your_view_display_name') {
              // Do some JS here



})(jQuery, Drupal, drupalSettings);

This is working fine. I am able to achieve my adding class functionality after the view result rendered.

But this WeberAjaxView default ajax call causing the other ajax also.

I want to do ajax call for this view alone. It should not disturb others ajax calls.

Please someone help me to solve this.

Tags : views 8

Related Questions

Alter the moderation state in the Content view Drupal 8

Updated February 28, 2018 21:07 PM

Group items in Views by value in Field Collection

Updated July 20, 2015 13:03 PM

List of referenced entities appended to a node

Updated January 12, 2017 08:03 AM