mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-20 21:49:27 +00:00
FilterWidget bugfix
- Now is possible to remove selected filters in "Filter options" - Changed the class of the delte button from remove-filter (already used) to remove-selected-filter - Added click event to remove-selected-filter class and the ajax call
This commit is contained in:
@@ -94,6 +94,23 @@
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".remove-selected-filter").click(function(event) {
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/removeSelectedFilters'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).attr('filterToRemove')
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
resetSelectedFilters();
|
||||
renderSelectedFilters();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function renderSelectedFilterFields(metaData, activeFilters, activeFiltersOperation, activeFiltersOption)
|
||||
@@ -210,7 +227,7 @@
|
||||
);
|
||||
|
||||
selectedFilters += '<span>';
|
||||
selectedFilters += '<input type="button" value="X" class="remove-filter btn btn-default" filterToRemove="' + data.selectedFilters[i] + '">';
|
||||
selectedFilters += '<input type="button" value="X" class="remove-selected-filter btn btn-default" filterToRemove="' + data.selectedFilters[i] + '">';
|
||||
selectedFilters += '</span>';
|
||||
|
||||
selectedFilters += '</div>';
|
||||
|
||||
Reference in New Issue
Block a user