I have a repeater set to a dataset with a filter configured in the dataset properties and a page size.
When the dataset initially loads it works perfectly per the pre-configured filter and page size.
Then I have the ability to filter the dataset via an input text field. I am using setFilter() to accomplish this.
The results returned per this new filter are as expected. However, it’s not abiding by the originally set page size. I can log the dataset’s page size and it still has what I configured.
How do I build a filter via code with a page size in order to “load more” via a function?
If you read the Wix Dataset API info you will find your answer.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFilter
Setting a dataset’s filter overrides existing filters that were previously set using the setFilter() function or using the Dataset Settings panel in the Editor.
Good Morning
I almost put the disclaimer that I have read the API reference documents which is what fueled my confusion.
Here are a few points maybe you could help clear up for me:
-
I read where setting a dataset’s filter overrides existing filters, but I couldn’t determine if PAGE SIZE was included in that. It’s a separate setting in the settings panel from filter and it’s a separate function in the API set.
-
If setting the filter does override the page size, then why is it when I call getPageSize() after setting the filter it returns the original page size I set in the settings panel? If it does overwrite it I would expect it to comeback undefined or something.
-
MOST IMPORTANT…how do I properly set the filter AND a page size? It doesn’t look like I can pass the page size to the filter. If I call setPageSize() and then call setFilter after does that not recurs back to “setting a dataset’s filter overrides existing filters…”. This was the crux of my question.
Thank you!