i need to filter the result of another filter from another dataset.
this is the filtering function:
function search() {
let productFilter = wixData.filter();
let categorie = $w(“#categorieBtn”).value;
let instrument = $w(“#instrumentBtn”).value;
let gen = $w(“#genDropdown”).value;
let locatie = $w(“#locatieDropdown”).value;
let luna = $w(“#lunaBtn”).value;
let anul = $w(“#anulBtn”).value;
let ziua = $w(“#ziuaBtn”).value;
if (gen) {
productFilter = productFilter.eq("genMuzical", gen) }
if (locatie) {
productFilter = productFilter.eq("locatie", locatie); }
if (categorie) {
productFilter = productFilter.eq("categorie", categorie);}
if (instrument) {
productFilter = productFilter.eq("instrument", instrument).or(productFilter.eq("instrument2", instrument)); }
if (ziua) {productFilter = productFilter.eq("zi2", ziua);}
if (luna) {productFilter = productFilter.eq("luna", luna).or(productFilter.eq("luna2", luna));}
if (anul) {productFilter = productFilter.eq("liberAn", anul).or(productFilter.eq("an", anul)).or(productFilter.eq("an2", anul));}
$w('#dataset1').setFilter(productFilter)
.then(() => {
let re = $w("#dataset1").getCurrentItem()._owner;
wixData.query('querydataset2').eq("_owner", re)
let filt = wixData.filter();
filt = filt.eq('_owner', re );
$w('#dataset2').setFilter(filt)
});
}
$w(" #genDropdown , #locatieDropdown , #categorieBtn , #instrumentBtn , #ziuaBtn , #lunaBtn , #anulBtn ").onChange(function () {
search(); });
the problem is that after I filter dataset1, I get only one item … and in that dataset there are several items that match the filters.
please help me … for many days I keep trying to solve the problem … how to get all the items after filtering dataset1 … and after, the filtered items + fieldkey ul (‘’ _owner ") to go through the query dataset2.
i need help …