Sorting filtered data by Price/Alphabetical field/etc?

I’ve been searching for a couple days on how to make my data sortable with a drop down by Price, and alphabetical in some of the fields. Cannot find any information except a dead topic that didn’t have it answered. None of the coding I tried worked.

I just want people to be able to filter the list however they want, then sort it by Price, Location Names, or Breed Names.

Page in question:
https://rabbitcenter.wixsite.com/rabbitcenter/saleslistings

Can you screenshot your current code.

@gerardo sorry just saw this, thank you for your response! I don’t actually know what code to use in the first place. I haven’t been able to find any coding examples of how to sort after filtering :\

@deleteduser OH, does this not work with a repeater? :frowning: It’s coming up with an error when I put in my repeater instead of the table code? (Im extremely new to js!)

export function searchList_change(event) {
wixData.query(‘#dataset1’)
.contains(‘betweenPrice’, $w(‘#sortDropdown’).value)
.find()
.then(res => {
$w(“#repeater1”).rows = res.items;
});
}

@deleteduser Also, I should add, I don’t really know how to even filter by price, since whenever I try I just get errors. For some reason I can filter my other text menus, but numbers just aren’t working. I tried to make one of the drop downs filter by price and it wouldn’t work at all.

@deleteduser It doesn’t seem to be working, hmm. It’s not changing anything. This is what I have right now. Maybe i dont have the prices set right?

export function searchList_change(event) {
wixData.query(‘#dataset1’)
.contains(‘betweenPrice’, $w(‘#priceDropdown’).value)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
});
}

It’s just not filtering anything at all:

https://rabbitcenter.wixsite.com/rabbitcenter/saleslistings

This is the coding I’m using for the rest of my filters:

let breedValue;
if ($w(“#breedDropdown”).value === “All”) {breedValue = false ;}
else {breedValue = $w(“#breedDropdown”).value;}
if (breedValue){
filter = filter.eq(“breed”, $w(“#breedDropdown”).value);
}

@deleteduser So I would need to have it as a text field? There’s no way to have it filter the numbers based on some ge/le type field?

@deleteduser Thank you for sharing that method. If I can’t find out a way to make it work as a number field, I will definitely be able to use this! <3