Filter
';$('.checked-filters-items').append(sHTML);/* Na het toevoegen van het filter, het 'verwijderen' van deze set toevoegen */$('#SelectedGroupFilter'+iParentFilterId).on('click', function () {iParentFilterId = $(this).attr('data-id');/* Checkboxes unchecken */var oCheckbox = $('.Filter-Window[data-id='+iParentFilterId+'] input:checkbox');if(oCheckbox.length !== 0) {oCheckbox.each(function (index, element) {if ($(element).is(':checked')) {ToggleItem(element.id, true);}});} else {/* Slider resetten */var maxValuevar oRangeSlider = $('.Filter-Window[data-id=' + iParentFilterId + ']').find('.rangeslider');if(oRangeSlider.length !== 0) {maxValue = oRangeSlider.slider('option', 'max');oRangeSlider.slider('values', [0, maxValue]).trigger('change');$('.Filter-Window[data-id=' + iParentFilterId + '] .MinValue .val').html(0);$('.Filter-Window[data-id=' + iParentFilterId + '] .min-val-input').val(0);$('.Filter-Window[data-id=' + iParentFilterId + '] .MaxValue .val').html('Onbeperkt');$('.Filter-Window[data-id=' + iParentFilterId + '] .max-val-input').val(maxValue);var sType = oRangeSlider.attr('data-type');if (sType === 'Stock') {$("#MinStock").val(0);$("#MaxStock").val(maxValue);} else if (sType === 'Price') {$("#MinPrice").val(0);$("#MaxPrice").val(maxValue);}}}/* Element verwijderen. */$(this).remove();/* Bepalen of de resetknop en header zichtbaar zijn. */ToggleFilterBlock();CategoryFilter(true, true, bInfiniteScroll);});}/** * Als het filter een slider is en er zijn values, maak dan een selected filter aan */function CreateSelectedSlider(oParentFilter) {var oRangeSlider = oParentFilter.find('.rangeslider');if (oRangeSlider.length === 0) {return;}var aValues = oRangeSlider.slider('option', 'values');/* Min en Max value moeten wel anders zijn dan default. Anders is er niks geselecteerd. */if(aValues[0] === oRangeSlider.slider('option', 'min') && aValues[1] === oRangeSlider.slider('option', 'max')) {return;}var MinHTML = oParentFilter.find('.MinValue').html();var MaxHTML = oParentFilter.find('.MaxValue').html();var sParentTitle = GetParentFilterTitile(oParentFilter);/* Bepalen wat het label is van de regel. */return sParentTitle + ': ' + MinHTML + ' t/m ' + MaxHTML+ '';}/** * Maakt selected filters aan obv de checkboxes */function CreateSelectedCheckboxes(oParentFilter) {/* De namen van de geselecteerde checkboxes ophalen. */let aFilterLables = GetCheckedFilterNamesByParent(oParentFilter);/* Niks geselecteerd, hoeft hier verder niks te gebeuren. */if(aFilterLables.length === 0){return;}let sParentTitle = GetParentFilterTitile(oParentFilter);/* Bepalen wat het label is van de regel. */return sParentTitle + ': ' + aFilterLables.join(' of ')+ '';}function CreateSelectedColors(oParentFilter) {/* De data (style en class) van de geselecteerde checkboxes ophalen. */let aFilterLables = GetCheckedColorsNamesByParent(oParentFilter);/* Niks geselecteerd, hoeft hier verder niks te gebeuren. */if(aFilterLables.length === 0){return;}let aColorLabels = [];/* Per geselecteerde kleur een ronde swatch maken. */for (var i in aFilterLables) {let sLabel ='
'+'
' +'
'+'
'+'
'+'
';aColorLabels.push(sLabel);}/* Bepalen wat het label is van de regel. */return aColorLabels.join('');}/** * Haal de title op van de Filter groep. Filter eventueel de voorloop eraf. */function GetParentFilterTitile(oParentFilter) {var sParentTitle = '';oParentFilter.find('.Title').each(function () {/* Voor de sup-filters willen wij enkel wat achter de - staat. */var sParentValue = $(this).find('a').text().split("-");sParentTitle = sParentValue.pop().trim();});return sParentTitle;}/** * Geeft de namen terug van de geselecteerde filter obv een Group * @param oParentFilter * @returns array * @constructor */function GetCheckedFilterNamesByParent(oParentFilter) {var aFilterLables = new Array();oParentFilter.find('li').each(function () {if ($(this).find('input').prop('checked') === true) {var filterTitle = $(this).find('a').text().trim();aFilterLables.push(filterTitle);}});return aFilterLables;}/** * Geeft de style en class terug van de geselecteerde kleurenfilter obv een Group * @param oParentFilter * @returns array * @constructor */function GetCheckedColorsNamesByParent(oParentFilter) {let aFilterLables = [];oParentFilter.find('.colors__swatch-round').each(function () {if ($(this).find('input').prop('checked') === true) {let filterObject = [];filterObject['class'] = $(this).data('class');filterObject['style'] = $(this).data('style');aFilterLables.push(filterObject);}});return aFilterLables;}/** * Bepalen of de container met filters zichtbaar moeten zijn. */function ToggleFilterBlock() {if ($('.checked-filters-item').length) {$('.checked-filters-container').show();} else {$('.checked-filters-container').hide();}}/** * Unchecken van alle geselecteerde filters, verbergen container * @constructor */function ResetFilters() {$('.Filter-Window input:checkbox').attr('checked', null);$('.Filter-Window').each(function () {var maxValue;$(this).find('.rangeslider').each(function () {maxValue = $(this).slider('option', 'max');$(this).slider('values',[0, maxValue]);var sType = $(this).attr('data-type');if (sType === 'Stock') {$("#MinStock").val(0);$("#MaxStock").val(maxValue);} else if (sType === 'Price') {$("#MinPrice").val(0);$("#MaxPrice").val(maxValue);}});$(this).find('input:checkbox').prop('checked', false);$(this).find('.MinValue .val').html(0);$(this).find('.min-val-input').val(0);$(this).find('.MaxValue .val').html('Onbeperkt');$(this).find('.max-val-input').val(maxValue);});CategoryFilter(true, true, bInfiniteScroll);$('.checked-filters-item').remove();$('.checked-filters-container').hide();}
Toon alle resultaten
- Cilinders voor deuren
- Ronde cilinders en ombouwsets
Filter
' + iNewStaffelPrice;ePriceElement.find('.Price').html(hNewPrice);eUnitElement.html(iUnitNumber);});$(document).on('change', '.Filter-Window .jsChangeGetResults', function () {var bInfiniteScroll = true;ContinueScroll = true;bShowLoading = true;$("#spinner_infiniteScroll").show();CategoryFilter(true,bShowLoading,bInfiniteScroll);})if ($('.Filter-Window').length !== 0) {InitCategoryFilter();}});function InitCategoryFilter () {FilterKey2Url = false;var bInfiniteScroll = false;var bShowLoading = false;bInfiniteScroll = true;bShowLoading = true;$("#spinner_infiniteScroll").show();CategoryFilter(false,bShowLoading,bInfiniteScroll);}function ChangeLayout(iLayout, iColorScheme, iSecondColorScheme){$('.layout_link').removeClass('active');$("#layout_"+iLayout).addClass('active');$('#filter_properties #CategoryLayoutId').val(iLayout);$('#filter_properties #ColorSchemeId').val(iColorScheme);$('#filter_properties #SecondColorSchemeId').val(iSecondColorScheme); var bInfiniteScroll = true;ContinueScroll = true; bShowLoading = true; $("#spinner_infiniteScroll").show(); CategoryFilter(true,bShowLoading,bInfiniteScroll);}var delay;function CategoryFilter(bResetPaginator, bShowLoading, bInfiniteScroll){if(bResetPaginator == undefined) {bResetPaginator = false;}if(bShowLoading == undefined){bShowLoading = true;} if(bInfiniteScroll == undefined){bInfiniteScroll = false; }clearTimeout(delay);delay=setTimeout(function(){if(bShowLoading){$('.Ajax-Loading').show();}var aFilters = new Array;$("#filter_properties :input:not([type='checkbox'])").each(function(){var sPropertyName = $(this).attr('id');var sPropertyValue = $(this).val();var aProperty = sPropertyName.split('_');if(aProperty.length > 1) {// Bij de range slider willen we alleen filteren als de filter ook daadwerkelijk actief is.if($(".Filter-Window li #ToggleShowAllKeywords_" + aProperty[1]).is(':checked')){aFilters[sPropertyName] = sPropertyValue;}} else {if(sPropertyValue !== ''){aFilters[sPropertyName] = sPropertyValue;}}});// gather all checkbox based checked checkbox values$(".Filter-Window .Filter2918355_checkbox:checked").each(function(){if((typeof aFilters['Keywords_2918355']) !== 'object') {aFilters['Keywords_2918355'] = [];}aFilters['Keywords_2918355'].push($(this).val());});$(".Filter-Window select#Filter_Keywords_2918355").each(function(){if((typeof aFilters['Keywords_2918355']) !== 'object') {aFilters['Keywords_2918355'] = [];}aFilters['Keywords_2918355'].push($(this).val());});// gather all toggle based checked checkbox values$(".Filter-Window .Filter2918355_toggle:checked").each(function(){if(aFilters['Keywords_2918355'] === undefined) {aFilters['Keywords_2918355'] = 0;}aFilters['Keywords_2918355'] = $(this).val();});// gather all checkbox based checked checkbox values$(".Filter-Window .Filter2918358_checkbox:checked").each(function(){if((typeof aFilters['Keywords_2918358']) !== 'object') {aFilters['Keywords_2918358'] = [];}aFilters['Keywords_2918358'].push($(this).val());});$(".Filter-Window select#Filter_Keywords_2918358").each(function(){if((typeof aFilters['Keywords_2918358']) !== 'object') {aFilters['Keywords_2918358'] = [];}aFilters['Keywords_2918358'].push($(this).val());});// gather all toggle based checked checkbox values$(".Filter-Window .Filter2918358_toggle:checked").each(function(){if(aFilters['Keywords_2918358'] === undefined) {aFilters['Keywords_2918358'] = 0;}aFilters['Keywords_2918358'] = $(this).val();});//Window(s) active/disabled$(".Window .Filter-Window").each(function(){if (aFilters['HideFilter'] === undefined) {aFilters['HideFilter'] = [];}var oElem = $(this).find('div');if (oElem.hasClass('Disabled')) {aFilters['HideFilter'].push(oElem.attr('id'));}});if (bResetPaginator) {aFilters['Page'] = 1;} if (bInfiniteScroll) { aFilters['bInfiniteScroll'] = true; }//Ajax callxajax_CategoryFilter(aFilters);}, 300);}function SetFilterKey(sKey){if (!FilterKey2Url) {return;}window.location.hash = 'filter:'+sKey;} $(window).bind('scroll', function() { if($(window).scrollTop() >= $('#ProductContainer').offset().top + $('#ProductContainer').outerHeight() - window.innerHeight) { if(ContinueScroll == true) {ContinueScroll = false; CategoryFilter(false, false); } } });$(document).ready(function(){// Back button in chrome werkt anders, waardoor de laad meer knop niet werkte na het bezoeken van een andere pagina en dan terug te gaan.// Zodra er op laad meer is geklikt komt er een hash in de url, dan dus onthouden dat er daar op is geklikt.var hash = window.location.hash.substr(1);if(hash) {$('#Page').val(1);} if($(window).height() == $(document).height()){ CategoryFilter(false, false, true); }// Fix voor chrome omdat de terugknop een back to state is ipv een echte pageload.// Kan dit niet omzetten naar een JS var. Dit leverd andere problemen op met o.a. pagina systeem$('#Page').val(1); });//]]>