@ladanimario ok. So in that case, you need to make a small change.
First take my code out of the $w.onReady() and dataset.onReady(0, and put it in a function:
function omitDuplicates() {
//put here my code. Make sure you don't copy the onReady() parantheses to here.
}
$w.onReady( function() {
$w("#dataset1").onReady( () => {
omitDuplicates();
})
})
export function clearFIlters_onClick(event) {
//keep your filtering code and the add:
omitDuplicates();
}
@ladanimario you have an extra }) there (twice! ). Just delete them. They belong to the onReady() functions
(I mean: delete lines 36-37 of your screenshot)
@jonatandor35 I learned so much from you today - this is unbelievable!!! Many thanks. I will store it in my code books!!! Please do not see me as a begger but I have one more issue with this code.
When chosing an item from the dropdown, it lists the duplicates as well. Any chance that I can fix that easily?
Btw. are you a professional at wix? anyway that I can reach out to your supervisor and tell them what an awesome job you did today?
@jonatandor35 Hi Hombre, I have two dropdowns that communicate with each other. When i click on a value of the first dropdown it shows again the “firma” duplicates. Kindly see here
@jonatandor35 Unfortunately that did not help me, it has mixed up our previous setting. When loading the page it shows the duplicates of “firma”. When clicking reset, and click then on the dropdown, I suddenly see the “firma” in the dropdown list
My problem: when clicking on any dropdown1 value (hauptkategorie), the various companies (firma) are listed more than once.
@ladanimario actually I’ma little bit confused and not sure what exactly you’re saying.
It sounds like you have a complicated flow there, and something is missing. That’s why it doesn’t work.
But I think you can find the basic concept and direction in my code and adjust it to your specific scenario.
@ladanimario you need to call omitDuplicates() every time you run a filter.
so for example, if you run a filter when the user selects an option from the dropdown, you should call the omitDuplicates() once the setFilter() promise has been resolved (like you did for the “Reset” filter).
Does it answer your question?
@jonatandor35 Hi Hombre - sorry for my late reply. I fell asleep unofrtunately. However I am up and running but my code does not haha. I have tried to swirl it around before bothering you… but no luck
@ladanimario ,I’ve almost never used pagination, so I can’t provide a solution without exploring it. Maybe you should try calling the omitDuplicates() function after you move to the previous/next pagination page (check the api documentation to see how to do it, and if it’s a promise, remember to use .then() ).