Skip to content

Instantly share code, notes, and snippets.

Created August 17, 2022 09:39
What would you like to do?
(function ($) {
'use strict';
Drupal.behaviors.myexposedfilterajax = {
attach: function (context) {
// On change of the main filter select list.
$('.master-select-list select').change(function (event) {
var selectedCategory = $(this).find(":selected").val();
var endpoint = Drupal.url(mycustom/filter/ajax/' + selectedCategory);
Drupal.ajax({ url: endpoint }).execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment