Dynamic page filtering not working after coming back from Dynamic Item page

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 ()); 
}) 

});

any advice on this? thanks

You are using a - → DATASET right?

What is the first rule when working with datasets?
Shouldn’t your dataset first be READY ???

$w('#dynamicDataset').onReady(()=>{#
	// code............
});

Maybe this already solve your issue?

I thought that in order to have the page ready, the dataset will have to be ready. Anyway, this does not fix the issue :frowning:

any solution? thanks