Hi everyone,
I've hit a really silly roadblock.
I have a Dynamic Page with a couple of Multi-state boxes, a search bar and a Repeater.
Everything works well, except I seem completely unable to filter my dataset. I'm filtering the "Wix" way, by adjusting the settings of the Dataset to exclude certain values, but it simply doesn't work, My code is below (although I've applied the filters traditionally) does anyone have any ideas please?
import wixData from "wix-data"; $w.onReady(function () { $w("#button1").onClick(() => { $w("#statebox8").changeState("Open"); }); $w("#button3").onClick(() => { $w("#statebox8").changeState("Closed"); }); $w("#button5").onClick(() => { $w("#statebox9").changeState("Open1"); }); $w("#button6").onClick(() => { $w("#statebox9").changeState("Closed1"); }); $w.onReady(function () { $w('#repeater').collapse() $w("#searchbutton").onClick(()=>{ $w('#repeater').expand() $w('#repeater').show() $w("#dynamicDataset").setFilter(wixData.filter() .contains("title", $w("#searchbox").value)); }); }); });
I've worked this out. For the benefit of anyone who has a similar problem, I amended the code to filter out certain fields using the .ne command import wixData from "wix-data"; $w.onReady(function () { $w("#button1").onClick(() => { $w("#statebox8").changeState("Open"); }); $w("#button3").onClick(() => { $w("#statebox8").changeState("Closed"); }); $w("#button5").onClick(() => { $w("#statebox9").changeState("Open1"); }); $w("#button6").onClick(() => { $w("#statebox9").changeState("Closed1"); }); $w('#repeater').collapse() $w("#searchbutton").onClick(()=>{ $w('#repeater').expand() $w('#repeater').show() $w("#dynamicDataset").setFilter(wixData.filter() .ne("examType", "Independent").contains("title", $w("#searchbox").value)); }); });