$(document).on('Application.calendarGroupFilterChanged', function(event, args) { var selectedGroups = args.groups || []; $('.calendar').each(function() { var label = $(this); if (selectedGroups.indexOf(label.attr('data-group')) >= 0) { label.show(); } else { label.hide(); } }); });