Hi!
I have been using the following code for a search bar and a drop-down filter on my site for filtering my datasets and it has been working fine. But now I've decided to put all the data into one dataset and create dynamic pages. As I expected the code I've been using now show all the data from dataset when filtering and searching instead for only the results I already have filtered when creating a dynamic page. What string do I have to add to my code for only search for results in the dynamic page? Grateful for all help!
import wixData from 'wix-data'; $w.onReady(() => { })
let debounceTimer;
export function input1_keyPress(event) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
$w("#dynamicDataset").setFilter(wixData.filter()
.contains("title", $w("#input1").value))
}, 500);
}
export function dropdown1_change(event) { $w("#dynamicDataset").setFilter(wixData.filter() .contains("lan", $w("#dropdown1").value)) }
Having same problem
Pls give a solution.
you need a column in your collection to identify which dynamic page each line of data belongs to, then you just add that column to your filter.