Hi,
I need to filter my dynamic dataset and then call the getNextDynamicPage() function. The filter however seems to be ignored and getNext function reverts to the filter placed on the Editor page.
Any ideas?
NB: I’ve even gone to the lengths of calling an OnReady function to give the filter time to update the dynamic set to no avail.
Here’s my code:
export function skipButton_click(event) {
var order = $w("#dynamicDataset").getCurrentItem();
wixData.query("TargetRoads")
.eq('_id', order.areaId)
.find()
.then((results) => {
//Account exists
if (results.items.length > 0) {
let area = results.items[0];
$w("#dynamicDataset").setFilter(wixData.filter()
.eq('areaId', area._id).eq('status', 'In Progress')
)
.then(() => {
console.log("Dataset is now filtered");
console.log("Area id is: " + area._id)
$w("#dynamicDataset").onReady(() => {
$w('#dynamicDataset').getNextDynamicPage()
.then((next) => {
console.log(next)
// wixLocation.to(next)
})
})
})
.catch((err) => {
console.log(err);
});
}
})
}