There is a problem with populating a gallery with content.
Basically when viewing a car(dynamic item page), the gallery(which has items from another database that is filtered to only show based on the current dynamic item), when you click on another car from the bottom(there is a repeater that showcases other cars) it changes the info from the dynamic dataset, but the gallery doesn't change.
(it will be only for mobile - so basically desktop version design is just the elements thrown there).
The setup is quite straight forward the main database CARS, and a database IMAGES.
Images have an image field, and a "cars" reference field, referenced back to cars.
On the dynamic page, the gallery dataset is filtered to show only images from the current item(Car) - from dynamic dataset.
On the bottom of the page there is the "recomended cars" which is basically a repeater, showing other cars(from the CARS database).
On container onclick there is this
wixLocation.to("/redirect?id=" + $item("#dataset2").getCurrentItem()["link-Ads-_id"])
Basicly, at first i just had it like this
But it kept not loading the gallery correctly ( it was keeping the last item's images, not the current ones.)
So what i did is create a "Redirect" page and pass the link of the car there, and on the redirect page get the link of the car and redirect the user to it.I thought it would fix the issue and load the Gallery succesfully.Nothing.
I even tried re-filtered the images dataset(onready)...(even though i already have set the filter from the Dataset Filter UI)
await $w("#dataset1").setFilter(wixData.filter() .eq("ad", $w("#dynamicDataset").getCurrentItem()._id) )
Im just out of ideas as to what is goig on...