I have a dataset #dataset1. I have a few filters which are applied by different buttons. It all seems to work fine with the EXCEPTION of the fact that the filter applies after the #repeater1 is displaying the content. That means that it takes about 5 seconds before the repeater is updated with the new filter. I have seen this discussed prevously but I cant seem to find an answer that works…
Here is my code
import wixData from ‘wix-data’ ;
$w.onReady( function () {
$w( ‘#headertransition’ ).onViewportLeave(()=> {
$w( ‘#scrollingheader’ ).show();
$w( ‘#defaultheader’ ).hide();
})
$w( ‘#headertransition’ ).onViewportEnter(()=> {
$w( ‘#scrollingheader’ ).hide();
$w( ‘#defaultheader’ ).show();
})
});
export function brostknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “tag” , “bröst” ));
$w( ‘#brostbo’ ).show();
$w( ‘#text169’ ).show();
$w( ‘#aterstallknapp’ ).show();
$w( ‘#kroppknapp’ ).hide();
$w( ‘#ansikteknapp’ ).hide();
$w( ‘#rekonknapp’ ).hide();
$w( ‘#injektionknapp’ ).hide();
$w( ‘#repeater1’ ).show();
}
export function aterstallknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter());
$w( ‘#repeater1’ ).hide();
$w( ‘#kroppknapp’ ).show();
$w( ‘#ansikteknapp’ ).show();
$w( ‘#rekonknapp’ ).show();
$w( ‘#injektionknapp’ ).show();
$w( ‘#brostbo’ ).hide();
$w( ‘#text169’ ).hide();
$w( ‘#aterstallknapp’ ).hide();
$w( ‘#brostknapp’ ).show();
$w( ‘#kroppbox’ ).hide();
$w( ‘#ansiktebox’ ).hide();
$w( ‘#rekonbox’ ).hide();
$w( ‘#injektionbox’ ).hide();
}
export function kroppknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “tag” , “kropp” ));
$w( ‘#brostknapp’ ).hide();
$w( ‘#ansikteknapp’ ).hide();
$w( ‘#rekonknapp’ ).hide();
$w( ‘#injektionknapp’ ).hide();
$w( ‘#text169’ ).show();
$w( ‘#aterstallknapp’ ).show();
$w( ‘#kroppbox’ ).show();
$w( ‘#repeater1’ ).show();
}
export function ansikteknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “tag” , “ansikte” ));
$w( ‘#brostknapp’ ).hide();
$w( ‘#kroppknapp’ ).hide();
$w( ‘#rekonknapp’ ).hide();
$w( ‘#injektionknapp’ ).hide();
$w( ‘#text169’ ).show();
$w( ‘#aterstallknapp’ ).show();
$w( ‘#ansiktebox’ ).show();
$w( ‘#repeater1’ ).show();
}
export function rekonknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “tag” , “rekonstruktiv” ));
$w( ‘#brostknapp’ ).hide();
$w( ‘#ansikteknapp’ ).hide();
$w( ‘#kroppknapp’ ).hide();
$w( ‘#injektionknapp’ ).hide();
$w( ‘#text169’ ).show();
$w( ‘#aterstallknapp’ ).show();
$w( ‘#rekonbox’ ).show();
$w( ‘#repeater1’ ).show();
}
export function injektionknapp_click(event) {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “tag” , “injektion” ));
$w( ‘#brostknapp’ ).hide();
$w( ‘#ansikteknapp’ ).hide();
$w( ‘#rekonknapp’ ).hide();
$w( ‘#kroppknapp’ ).hide();
$w( ‘#text169’ ).show();
$w( ‘#aterstallknapp’ ).show();
$w( ‘#injektionbox’ ).show();
$w( ‘#repeater1’ ).show();
}
Anyone with a clue of what to do? Please bare in mind that I am NOT a coding expert so please be patient with me and if possible give a step by step code answer…