Hi @noahlovell
I created a new page and migrated the code from the existing page. The code is almost identical, except for the #text element. The new page does not seem to have any glitches, or at least none that are obvious.
If that’s the case, what could be causing the existing page to have issues while the new one works fine, even though the code is nearly the same with only minor changes? Here is the code:
import wixData from “wix-data”;
$w.onReady(() => {
$w(“#dataset1”).onReady(() => {
updateCountsAndOrder();
});
$w(“#repeater1”).onItemReady(($item, itemData, index) => {
// Handle Row Numbering
$item(“#text45”).text = ${index + 1};
if (!itemData.venue) {
$item("#text51").collapse();
} else {
$item("#text51").expand();
}
});
$w(“#dropdown1”).onChange(() => applyFilters());
$w(“#dropdown2”).onChange(() => applyFilters());
});
function applyFilters() {
const type = $w(“#dropdown1”).value;
const year = $w(“#dropdown2”).value;
let filter = wixData.filter();
if (type && type !== “RESET_ALL”) {
filter = filter.eq(“type”, type);
}
if (year && year !== “RESET_ALL”) {
filter = filter.eq(“year”, Number(year));
}
$w(“#dataset1”)
.setFilter(filter)
.then(() => {
updateCountsAndOrder();
console.log("Dataset filtered and order updated.");
});
}
function updateCountsAndOrder() {
const count = $w(“#dataset1”).getTotalCount();
$w(“#text58”).text = ${count};
$w(“#text59”).text = ${count};
const options = ;
for (let i = 1; i <= count; i++) {
options.push({ label: i.toString(), value: i.toString() });
}
$w(“#repeater1”).forEachItem(($item, itemData, index) => {
$item(“#text45”).text = ${index + 1};
});
}