I have a table that is set up to display data in pages that are navigatable using paging buttons.
I have two date pickers and a button to filter the results of a dynamic dataset. How do I change the settings of the table so that it only displays the number of rows that result from the applied date filter?
I've tried this but it doesn't work.
export function button10_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
// Add your code for this event here:
let yearValue = $w('#datePicker1').value.getFullYear();
let monthValue = $w('#datePicker1').value.getMonth();
let dayValue = $w('#datePicker1').value.getDate();
let date1 = new Date(yearValue,monthValue,dayValue,0,0,0);
yearValue = $w('#datePicker2').value.getFullYear();
monthValue = $w('#datePicker2').value.getMonth();
dayValue = $w('#datePicker2').value.getDate();
let date2 = new Date(yearValue,monthValue,dayValue,23,59,59);
$w('#dynamicDataset').setFilter(wixData.filter()
.between("date", date1, date2)
)
.then(() => {
$w("#table1").pagination = {"type": "normal"};
console.log("Filter is set.");
})
.catch((err) => {
console.log(err);
});
}