Created
August 17, 2022 09:39
-
-
Save binnyaxel/5f6fc73cc195f2a85471706d8fd96ec4 to your computer and use it in GitHub Desktop.
MyexposedFiltersAjax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
'use strict'; | |
Drupal.behaviors.myexposedfilterajax = { | |
attach: function (context) { | |
// On change of the main filter select list. | |
$('.master-select-list select').change(function (event) { | |
event.preventDefault(); | |
var selectedCategory = $(this).find(":selected").val(); | |
var endpoint = Drupal.url(mycustom/filter/ajax/' + selectedCategory); | |
Drupal.ajax({ url: endpoint }).execute(); | |
}); | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment