Hey friends!
I am trying to do something “simple” but I am still fairly new to coding so any help here is greatly appreciated.
Requirements:
-
Dynamically search by team name
-
Sort the repeating element that is connected to a dataset using dropdowns, one for year and the other for division
I have tried following along through forum posts and YouTube videos but I can’t seem to make it to the finish line on my own.
Webpage: https://www.hockeyfightsms.org/past-champions
(Incomplete/Not working) Code:
import wixData from 'wix-data';
// My search currently makes ALL data go away. And deleting my search term does not bring it back.
let debounceTimer;
export function iTitle_keyPress(event,$w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#iTitle').value);
}, 200);
}
let lastFilterTitle;
function filter(title){
if (lastFilterTitle !== title) {
$w('#dataset1').setFilter(wixData.filter().contains('teamName', title));
lastFilterTitle = title;
}
}
// I don't know how to write the correct function to make the drop-down filtering work
export function iYear_change(event) {
yearChange();
}
function yearChange(){
}
Thanks!