So I’ve completed this tutorial. It is creating a “search” and a “dropdown search” for my database repeater. It works perfectly. I completed it on a regular page.
The issue I’m having is that I need to create something like this on a dynamic category page. I copied the code exactly, but it doesnt seem to work on a dynamic page.
Any suggestions???
Code:
import wixData from “wix-data” ;
let debounceTimer;
export function iTitle_keyPress_1(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( ‘title’ , title));
lastFilterTitle = title;
}
}
Hello,
You may want to double-check that your selectors and event handlers have been modified to match the element ID’s on your dynamic page since the code was copied.
I’d also look into using the following APIs to identify the relation between the dynamic page and the items you’re searching for.
wix-data.query
dynamicDataset.getCurrentItem()
You may also want to review other similar posts in the forum to get a better idea. I’ve listed a few here:
I hope this helps!
Best regards,
Miguel
Thanks Miguel!
On the dynamic page, I have succesfully changed all my selectors, & event handlers to match the items on the dynamic page. The part that I’m struggling with is how to code in “wix-data.query” and “dyanamicDataset.getCurrentItem()”
My original page and my dynamic page is exactly the same. Except the original page has ALL LISTINGS, and my Dynamic Page is CATEGORIES.
I’m very new at coding, and all I do is just find what I’m looking for on youtube and copy it directly. It’s just that there are no videos or articles and searching a dynamic dataset with user input.
Would you know how to code those 2 things into the code?