How to filter dynamic page with search, dropdown and selectiontags?

Creating multiple filters on dynamic page.

Hi! I am trying to create multiple filters on my dynamic page. I have already added a searchbar and dropdown w/reset, and they seem to work well together. I would like to add selectiontags for additional content filtering, but I can’t get it to work properly.

Heres the code without the tags:

(code removed)

The above code seems to be working fine.

With the selectiontags added, the code looked like this (not working):

(code removed)

I would really appreciate if someone could point me in the right direction:)

Regards

Frode

I found one error in the last code… The

if (tagName)

should be

if (tag)

I think?

:slight_smile:

When I corrected the above error it kind of works, but not the way I want it to…

I also changed the

exportasyncfunction tagSelection_click

to an onChange event.

The link to the page is here:

www . lateharvest . no / skole (I am not allowed to post links yet)

When i play around with the dropdown values, the collection filters instantly on change, but when I click the tags it works on click, but when I deselect (de-click) the tag, it displays zero results. Any way to avoid this? Can I make the filter return to it’s previous state when I deselect the selection tag?

How to filter dynamic page with search, dropdown and selectiontags?

You do not really filter a dynamic page, or am i wrong, when i say, you are filtering your DATABASE —> from <— a dynamic page ???

A dynamic page is just one “row-data” in your DB which is connected trough a DATASET to show the DATA-VALUE of (just one selected row-data) in your DATABASE.

A good advice → please use “CODE-BLOCK” to show your code like…

my CODE here in this CODE-BLOCK (CODE-TAG)

Second advice… do just show CODE-PARTs which are related to your current issue, do NOT add CODE which is not needed and not related to your issue, that makes things easier and more speeds up the helping process.

You may also take a look onto this example here…

https://www.media-junkie.com/pflegeservice

…where you will find some implemented DATABASE-PRESETS you can play with.
You surely will recognice similarity to your own project.

With the difference, that this example is totaly “DATASET-FREE” coded.

Since this example is an “interactive” one, you can change the DATA-PRESETS by your own and change DATA. All implemented and possible to use “DATABASES” you will find in the example (click on —> “DATABASES”).

To make some “SETUPs” you have just to push …

…and go to “PRESETS”. Setup your own PRESET (from given DBs) or just work with already installed (setted up) PRESETS.
You have 4-PRESETs (slots) of your choice.

More info about that interactive example (Filter-Tool) can be found within the example itself.

Have fun! :wink:

Thanks for the reply!

And thanks for the tips also. This is my first post here and I will certainly use code-block in the future:)

You are right, I am talking about filtering the collection (database) in a repeater on a dynamic page.

As for just sharing the part of the code related to the issue… that’s where I am on thin ice. Since I use parts of code found from tutorials and functions and filters seems to depend on order etc, I found it best to post the whole code. I am not really sure where it goes wrong…

I have it semi-working now, but I still have the issue with the selectiontags. When I select one, it filters (my collection) fine, but when it is deselected it shows me no results. I would like it to act like a button that switches the filter “on and off”.

Anyway, I will have a look at the link you provided.

Thanks again!

@russian-dima

Thanks for the reply!

And thanks for the tips also. This is my first post here and I will certainly use code-block in the future:)

You are right, I am talking about filtering the collection (database) in a repeater on a dynamic page. As for just sharing the part of the code related to the issue… that’s where I am on thin ice. Since I use parts of code found from tutorials and functions and filters seems to depend on order etc, I found it best to post the whole code. I am not really sure where it goes wrong…
I have it semi-working now, but I still have the issue with the selectiontags. When I select one, it filters (my collection) fine, but when it is deselected it shows me no results. I would like it to act like a button that switches the filter “on and off”. Anyway, I will have a look at the link you provided. Thanks again!

If you need more information how to code, like shown in the example, you can start here…


This button will lead you to the original post. Read all the given posts about this interactive example and perhaps soon you will be able to create things like this “Filter-Tool” by your own.

Also some “EASIER and with less complexity” generated CODE-EXAMPLES are given in the shown “Filter-Tool”. You have just to read a lot and to search for all the covered informations :grin:.

Some paralel topic…
https://www.wix.com/velo/forum/community-discussion/filtering-issue-1