I’ve got a database of items which is sorted by Resources, Reports and Projects. Some are current, and others are “archived” - which I’ve set up with a Boolean field that’s “true” if the item is archived.
I have two separate repeaters (on two separate pages) for users to look up current items and past items - which is filtered using the manage Dataset menu to filter between archived (true) and not archived (false) pages.
I have a drop-down field for them to choose the sort by type (resource, report or project). The sort works fine with the onChange function, but the problem is that the original filter on the Dataset that says if it shows archived items or not gets wiped out.
Is there a way to set the code so that I keep that first filter applied, but add in the filter for the type once someone chooses it in the drop-down?
Thanks!
export function selection_change(event, $w) {
$w("#dynamicDataset").setFilter(wixData.filter()
.eq("type", $w("#selection").value))
}
I need the full code you use (and a link to your site may help me provide you with better solution),
but as for now, the code you posted lacks a few things. Read this API reference about filtering data.
I am attempting to create a filter for my repeater as well. Can you please explain how you managed to get your code to work? I’ve made a post about this but have yet to receive a response and really need to get this figured out. Any feedback would be greatly appreciated.