Someone here tried to do a search for the products of the database store?
i try this link But it’s not working Wix Code | How to Create a Search for Your Database - YouTube
thanks
Someone here tried to do a search for the products of the database store?
i try this link But it’s not working Wix Code | How to Create a Search for Your Database - YouTube
thanks
Have you tried using a standard wixData.query?
yes i try this Search Code on Wix using Corvid to Display Results on another page - YouTube
but it’s not working
Hi,
Please share your code here.
//site header
import {local} from ‘wix-storage’;
import wixLocation from ‘wix-location’;
$w.onReady(function () {
});
export function searchButton_click() {
let word = $w(“#searchBar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/results
);
}
//results poage
import {local} from ‘wix-storage’;
import wixData from ‘wix-data’;
$w.onReady( function () {
var sameWord = local.getItem(“searchWord”);
$w("#searchBar").value = sameWord;
$w("#searchBar").placeholder = sameWord;
$w('#dataset1').onReady( **function** () {
search();
});
});
function search() {
wixData.query('Store/Produacts')
.contains(‘name’, $w(“#searchBar”).value)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
});
}
I did it thanks
Hi,
Roi.
I tried to put it in every possible place but it did not work
//
wixData.query(‘Products’).limit(5)
// can you help me
let lastFilterTitle;
let debounceTimer;
export function iTitle_keyPress(event, $w) {
$w(‘#repeater1’).show();
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w(‘#iTitle’).value);
}, 200);
}
function filter(title) {
if (lastFilterTitle !== title) {
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘name’, title));
lastFilterTitle = title;
}
}
?