Filtering/sorting a table or a list

Hello!

I’m trying to create a table or a list to display my rental houses. I would like the tenant candidates to be able to sort or filter the houses. For example if he would like to see only houses that rent for less than 1000 €. Or houses that are located in London only.

This would also work if he could sort the houses alphabetically. It would be enough to be able to sort the list from cheapest to the most expensive one.

I have created a database and dataset and linked them to a repeater, but I don’t know how to let the user filter/sort the data he sees.

Is either one of these options possible to do without coding? If coding is required, can someone give me a code that I can copy paste?

Thanks a lot in advance!

Hi! You can add filtering/sorting with this panel: 2018-01-16_1211

But, these will be constant sorting option, which can’t be changed by your user

User-set filters or sorting can be achieved only with code part…

I can’t give you exact code for this, you need to write it by yourself.
Helpful information is here:

Obviously, you need just to set different filters, which happen when user clicks some button for example

1 Like

I think constant sorting option is enough for my need.

I actually have added Dataset sorting just like in your screenshot, but it doesn’t show up when I preview the site. I also added a button and linked it to the Dataset, but the button can only be linked to Next Item, Previous Item, Next Page etc. Should it have A->Z option as well? Or how do I create the actual sorting option for the end user?

Also Dataset Settings only shows sorting option but no filtering. Should I change a setting somewhere to have filtering option?

As i said - without code you can set only 1 constant sorting. There is no way to change it in “runtime” in this case, without code.

Second - what do you mean by "it doesn’t show up when I preview the site "?
Sorting is not working?

Third - very strange. Can you please make a screenshot of what you see in this panel? I mean dataset settings

  1. Yeah, sorting is not working. When I set the sorting criteria and click Preview, I can see the table with all the data but there is no way to sort it.

Do I need to insert a sorting button or should the table have sorting mechanism by default?

  1. I got this working. Turns out the filter option is visible only when the page is not dynamic.

Hello Firewood,

You can use a dropdown box to allow the user to filter the table.
See an example here

1 Like

Hey Mikhail,

When I filter the dataset by another dataset it just returns 1 matching value and not all.

For example I have 2 Datasets and both of them have the same column ‘fileNumber’

While my 1st dataset has over 100 file numbers; my 2nd dataset has only 25 and there are 10 file numbers matching between them.

So if i apply the filter as the below on the 1st Dataset:
File Number is current Value from File Number (2nd Dataset)

It should be returning and displaying all the 10 file numbers in the table, right ?

Instead its just showing 1

Hi! Yes it should be all matching values. That mean that you either didn’t sync or set up smth wrong
Can you please share a link to your site? I can check

https://dudelemonweb.wixsite.com/concordeportal/dataset-test

Live site won’t work because of Database Permission issues

Found the problem. This feature doesn’t compare everything
It compares with CURRENT item in ArrivalsDB dataset. This means that if you add actions next-previous on that DS (by which you filter), you will see different values, because item BY WHICH you filter - will change

I’m not sire how to solve your problem without code…

Hmmm :frowning:

Why is the ArrivalsDB dataset getting only 1 item at a time ??

Shouldn’t it display all the items or the no. of items entered in the ‘Manage Dataset’ Box

Do you have any support document links which I can study to find a solution via code ?

Thank you Mikhail

No, because dataset chooses what to show based on “who is asking”. If it’s table - shows all. If it’s usual text box - shows only one item at a time.
In this case, this is just by design - this feature is mostly for creating filters.
About spport articles - no, there is no such example. You need to use wixData.query to get all items from 2 collections and then compare them, one by one…

i am facing the same problem…