Hi,
So i got my repeating row to work, and i found a way to make the content within it to collapse, but now i’m struggling with the search box and a filter box.
I want to filter on my database row called Title in the search box
I want to add a drop down filter for the Tiers that have multiple numbers (S, A, B, C, D)
I followoed this tutorial: but it isnt working for me, nothing filters.
What am I doing wrong?
This is my code:
import wixData from “wix-data”;
$w.onReady(() => {
loadTiers();
});
let lastFilterTitle;
let lastFilterTier;
let debounceTimer;
export function iTitle_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w(‘#iTitle’).value, lastFilterTier);
}, 500);
}
export function iTier_change(event, $w) {
filter(lastFilterTitle, $w(‘#iTier’).value);
}
function filter(title, tier) {
if (lastFilterTitle !== title || lastFilterTier !== Tier) {
let newFilter = wixData.filter();
if (title)
newFilter = newFilter.contains(‘articleTitle’, title);
if (Tier)
newFilter = newFilter.contains(‘Tier’, Tier);
$w(‘#dataset1’).setFilter(newFilter);
lastFilterTitle = title;
lastFilterTier = Tier;
}
}
function loadTiers() {
wixData.query(‘Tiers’)
.find()
.then(res => {
let options = [{“value”: ‘’, “label”: ‘All Tiers’}];
options.push(…res.items.map(continent => {
return {“value”: continent.title, “label”: continent.title};
}));
$w(‘#iTier’).options = options;
});
}
And this is my site link: https://heilhydra.wixsite.com/hydradidnothingwrong/tier-list