Did you happen to read page two (2) of the comments.
This is awesome!
One question - where are the dropdown item names in the code? I've replaced just enough, but when I click on my dropdown, all it says is "All types".
How do I add my dropdown items (University names) to the code so that they appear? I've tried connecting data, but that freezes the dropdown.
Any advice would be great! You guys are better than the wix boards!
Hi M,
We are glad you like our tutorial!
You are able to populate the dropdown options by modifying the first part of the code (below).
What the code does is to search for a specific field (e.g. "search") in the "Type" dataset and adds all the items in your dropdown options.
// Set Dropdown Options //
$w.onReady(() => {
wixData.query('Type')
.find()
.then(res => {
let options = [{"value": "", "label": "All Types"}];
options.push(...res.items.map(type => {
return {"value": type.search,"label": type.search};
}));
$w("#dropdownfilter").options = options;
})
});
Note: You should not connect your dropdown to the dataset via Wix Editor.
I hope this helps! Good luck!