Hello,
Sorry in advance - I am not familiar with code but am so happy this is now available on wix - thanks!
I have created a gallery which is linked to a dataset. There are dropdowns at the top of my page which each have a manually input dropdown list. The options in the dropdown list are equal to the data input in the relevant field. (eg Menswear/Womenswear dropdown only has two options; menswear or womenswear. In the dataset, the column with field key “menswearwomenswear” will have one of only two inputs; menswear or womenswear)
I want the user to be able to select options from the dropdowns which will then filter my gallery. Will they be able to select any drop down in any order and the filters still apply?
I also have a clear filters button at the top which will need to reset all the dropdowns.
I have spent a while trying to figure it out but ran out of trial and error options! Thank you!!
Hi,
You can check the explanation here to filter the relevant information using multiple user inputs and set the information to the gallery instead of the table as explained here .
I have tried to convert the table code to gallery but am doing a lot of guessing and receiving many errors. Please could you re-write the code for a gallery and user input dropdown buttons?
It is very hard for us to just write code without knowing what you’re doing.
Please try to specify the question, and add the piece of code that you think is problematic (not a lot of code, as it is hard to debug it).
Hereis the code Tal linked me to but I need to change the coding to work on a gallery instead of a table. I’m really sorry I don’t know much about code so have tried to change the highlighted parts to my references but it does not work (I assume because the code relates to rows and tables instead of a gallery and dropdowns). There is also a few words which seem to be in Hebrew from using Google translate?
Tal’s Instructions: 1. Get the original rows data from the dataset:
Hi Helen,
The hebrew words are just used for some extra filtering, nothing related to the logic of the code.
As Tal mentioned, this code will not work for gallery as table and gallery have a different APIs (see gallery API here ).
I understand the difficulties of getting into code when you’re not familiar with it, but this has to be the first step before making something to work.
We will be happy to help with any specific question regarding Wix Code, but we are unable to write the whole code for you.
I suggest you read the APIs a bit and give it a go. We’re here to help if you’re stuck.
I would like to show a button base on the selection of 3 separate dropdowns. Can you give me an example of this. I am able to do it with one dropdown but not all 3 results being = to certain values
Hi guys I’m having a small problem. I’ve tried troubleshooting myself but with no luck. I have implemented the above code with above corrections.
Everything seems to be working however I am finding that once I choose an option from my drop down menu it clears the entire table of all data… I have spell checked everything multiple times so no mistakes there. I have even changed my data set to contain just single words in one field (other fields are left blank, again for testing purposes).
I was unsure exactly what the fields and locations were referring to exactly and I imagine that is where my problems lie! I commented out some code that I thought might be unnecessary for my purposes. I currently have one drop down menu but will expand this too three or four as the initial post above illustrates. Below i have attached my code to show you what sections i have commented out. I have tried commenting out the location constant and if statement however this achieves the same result.
Thank you for your time and i would really appreciate your help.
function filterTable() {
let newRows = originalRows;
//const field = $w(‘#dropdown1’).value;
const location = $w(‘#dropdown1’).value;