Hello everyone, I need some help with a part of this tutorial Wix Code | How to Create a Search for Your Database - YouTube . So I followed it and the code is identical to the one presented (changed tsome IDs only), it works all fine, except the All Continents part. I think the guy goes to fast on that part and I don’t get something. So, I did not connect the filed to the database, I added all the possible countries to the list + “All countries”, but once I filter to a country, and then go back to All counties option, instead of showing all items back, a blank page is displayed. Maybe I missed something or did something wrong in setting the items. Can somebody help? Thank you!
Hay, just looked at the site and the filter by country seems to be working fine. I have selected Germany, Finland and Colombia and in all cases seem to have gotten the right result.
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);
}
Hi . I also have the same issue as well. i am fighting about 4h and getting overheated…
Dear Wix support, Could you please answer to the problem Maria is having?
Best Regards,
Hi Aaron,
This thread is a couple years ago. To get the best support for your problem, please create a new post with all relevant information, code, and screenshots. Here are our guidelines for reference. Thanks.