Hi,
I have this code working, to filter a database and then only show on a list the filtered items.
Can someone help me adding code that will also count the number of filtered items and display the count into an input box.
I already do this to count the total number of items into my database and post it in an input box
Thank you any help will be very much appreciated
Pierre
ibmretraitesqc
Here is my code for that filter option:
export function input3_keyPress(event, $w) {
if (debounceTimer) {1// clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout (() => {
filter1($w('#input3').value);
}, 200);
}
console.log (filter)
let lastFilterTitle2;
function filter1(title) {
if (lastFilterTitle2 !== title) {
$w('#dataset1').setFilter( wixData.filter().contains('nomComplet',title));
lastFilterTitle2 = title;
$w("#anchor1").scrollTo()
$w("#dropdown1").value = ""
$w("#input2").value = ""
}
//code.........code... $w('#dataset1').setFilter( wixData.filter().contains('nomComplet',title)) .then((res) => { let count = $w("#dataset1").getTotalCount(); $w("#text1").text = count.toString(); }) //the rest of the code...