Hi I’ve been having the same problem except now my dropdown bar doesn’t even react to anything & and All Items doesn’t even show up is there any solution to this?
Below are my codes… there doesn’t seem to be any errors but I’m also new with codes so…
#searchbar #searchfunction #searchdropdown
import wixData from "wix-data";
$w.onReady(() => {
wixData.query('projectType')
.find()
.then(res => {
let options = [{'value': '', "label": 'All Project Types'}];
options.push(...res.items.map(project => {
return {"value": project.name, "label": project.name};
}));
$w('#dropdown1').options = options;
});
});
let lastFilterTitle;
let lastFilterProject;
let debounceTimer;
export function iTitle_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#iTitle').value, lastFilterProject);
}, 500);
}
function filter(title, project) {
if (lastFilterTitle !== title || lastFilterProject !== project) {
let newFilter = wixData.filter();
if (title)
newFilter = newFilter.contains('groupName', title);
if (project)
newFilter = newFilter.contains('projectType', project);
$w('#dataset1').setFilter(newFilter);
lastFilterTitle = title;
lastFilterProject = project;
}
}
export function dropdown1_change(event, $w) {
filter(lastFilterTitle, $w('#dropdown1').value);
}