I have a repeater on the “make-of-car” page of my website with buttons labeled as Honda, Toyota, etc.
When I click on a button labeled,say Honda, I want a dropdown, to be shown on another page called the “model-of-car” page, populated with Honda models such as Accord, Civic, etc.
The dropdown is set to “Show on All Pages”. So I hide the dropdown on the “make-of-car” page and show it on the “model-of-car” page.
In the below code, dataset2 is connected to the repeater buttons, and dataaset5 is connected to the dropdown.
The problem is, the dropdown filter does not work. It does not filter and show only models pertaining to Honda. Instead, it shows all the models of all makes of cars.
I dont know where I am going wrong, or what changes I need to make to get the filter to work properly.
make-of-car page code
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w("#dropdown2").hide();
$w("#text25").text= "SELECT MAKE"
$w("#repeater2").onItemReady( ($w, itemData, index) => {
$w("#button2026").onClick( (event) => {
$w("#text27").text = $w("#text27").text + ", " + $w("#dataset2").getCurrentItem().title;
$w("#dataset5").onReady(() => {
$w("#dataset5").setFilter(wixData.filter().eq("title", "Honda"));
});
wixLocation.to("/model-of-car");
});
});
});
model-of-car page code
import wixData from ‘wix-data’;
$w.onReady(function () {
$w(“#dropdown2”).show();
$w(‘#text25’).text= “SELECT MODEL”
});