import wixData from 'wix-data'; $w.onReady(function () { // Make sure dataset is ready before filtering $w("#playersDataset").onReady(() => { // Optional: default to showing all classes $w("#classDropdown").value = "all"; filterByClass("all"); }); // When dropdown changes, filter the dataset $w("#classDropdown").onChange((event) => { const selectedClass = event.target.value; filterByClass(selectedClass); }); // Set up repeater item mapping when dataset has items $w("#rankingsRepeater").onItemReady(($item, itemData, index) => { // index starts at 0, so add 1 to show rank number // or use overallRank from DB if you prefer if (itemData.overallRank) { $item("#rankText").text = itemData.overallRank.toString(); } else { $item("#rankText").text = (index + 1).toString(); } // These are already connected by data bindings, but you CAN override if needed: // $item("#nameText").text = itemData.title; // $item("#positionText").text = itemData.position; // $item("#classYearText").text = itemData.classYear; // $item("#teamText").text = itemData.team; // If you want to handle the image manually: // if (itemData.headshot) { // $item("#headshotImage").src = itemData.headshot; // } // Example if you later add a profile page using profileSlug: // $item("#profileButton").onClick(() => { // wixLocation.to(`/player/${itemData.profileSlug}`); // }); }); }); /** * Filters the playersDataset by class year. * @param {string} classYear - "all", "2026", "2027", "2028" */ function filterByClass(classYear) { let filter = wixData.filter(); if (classYear && classYear !== "all") { // classYear is stored as TEXT in the collection in this setup filter = filter.eq("classYear", classYear); } // Apply filter and keep sort by overallRank ascending $w("#playersDataset") .setFilter(filter) .then(() => { // Optional: ensure sort still correct return $w("#playersDataset").setSort( wixData.sort().ascending("overallRank") ); }) .catch((err) => { console.error("Error filtering dataset:", err); }); }
top of page

Rankings

Rankings
 

Choose Class

blank 2026 in bold letters, make the letters white and the background navy.jpg

Mission

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

Vision

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

bottom of page