I have a repeater connected to dataset that is controlled by several user-input filters plus pagination bar.
I want to present (hide/show) to the user updated filter options ONLY after the previous filter was executed and the repeater is fully rendered.
I cannot find a way to catch the event when the repeater.rendered becomes True after the user apply new filter (or after advancing the pagination bar). Can someone point me in the right direction?
Thanks Ido,
Maybe my question was not clear.
I wanted to take advantage of the fact that when a dynamic page is called by the user, it's dataset is already filtered by the category field/s it is bound to, and I wanted to add additional filters to the current dynamic category field.
I know I can build the full filter (including the category field/s) and apply it to the datatset, but then I would control my dynamic page like any regular page, doing in code what the dynamic mechanism does.
What I was looking for was a way to use the already existing filter structure that the dynamic mechanism provides in each instance.
So in a regular page I use:
let myFilter = wixData.filter(); myFilter = myFilter.eq('categoryField', "currentCategory") .contains('extraFilter1', "value1") .contains('extraFilter2', "value2"); $w("#myDataset").setFilter(myFilter);
And in a dynamic page I would like to use a getFilter() which does not exist: let myFilter = $w("#myDynamicDataset").getFilter(); // .eq('categoryField', "currentCategory") myFilter = myFilter .contains('extraFilter1', "value1") .contains('extraFilter2', "value2"); $w("#myDataset").setFilter(myFilter); If something like this isn't possible, than I will manage the complete filter and probably will do it in a regular page instead of dynamic page.
What do you think?
Ofer
hi,
setFilter() returns a promise, which means you can hide the filter options before you set the filter then wait for the promise to fulfill before showing them again.
see the example here
https://www.wix.com/code/reference/wix-dataset.html#setFilter