Hello,
I have implemented a filter for my dynamic page which is working as intended. I have 23 buttons which represent letter in order to filter by starting letter on the press of a button. All is working fine, except that after I go on an item’s page and I press the back button to get redirected to the all items dynamic page, the filtering does not work anymore. I can see the logs being printed, but the filtering is not happening.
Thanks!
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
let array = Array ()
for ( let i = 1 ; i < 23 ; i ++) {
array . push ( $w ( “#button” + i ))
}
console . info ( array )
array . forEach ( element => {
element . onClick (()=> {
console . info ( "clicked" + element . label )
$w ( "#dynamicDataset" ) . setFilter ( wixData . filter ()
. startsWith ( "title" , element . label ));
});
})
$w ( '#button23' ) . onClick (() => {
$w ( '#dynamicDataset' ) . setFilter ( wixData . filter ());
})
});