Hello! I followed the search tutorial for my page (www(.)youtube(.)com(/)watch?v=Hx7_8-lRsW0 ) It was a simple code but for some reason it’s not working on my page
I used the code that it’s shown there but for some reason it’s not working for me~ And I don’t know if it’s because i’m using an text element input shown here:
Sorry it’s in spanish but you know what i mean
And I don’t know if it’s because I’m not using the search bar on the website (?) I tried to use on it but it just gives me on a new page that I didn’t want to. I tried to make a search like on the video (just looking for usernames and that is it)
And here is my code, it’s very simple, I know but I wanted to make it work first like in the video:
I don’t know if I’m missing something and I’m kinda desperate and would appreciate any help or suggestions!
Thank you for reading~ smoochs
can u post your website link here? I don’t see the code has bug for now
import wixData from ‘wix-data’ ;
var timer;
export function iptkey_keyPress ( event ) {
if ( timer ) {
clearTimeout ( timer );
timer = **undefined** ;
}
timer = setTimeout (() => { filterdata ( $w ( "#iptkey" ). value ), 3000 });
}
function filterdata ( key ) {
**var** newfilter = wixData . filter ();
newfilter = newfilter . contains ( 'bio' , key ). or ( newfilter . contains ( 'name' , key ))
$w ( "#dataset1" ). setFilter ( newfilter )
. then (() => {
returndis ()
});
}
function returndis () {
**var** count = $w ( "#dataset1" ). getTotalCount ();
**if** ( count === 0 ) {
$w ( "#txtdisplay" ). show ();
$w ( "#repeater1" ). hide ();
$w ( "#repeater1" ). collapse ();
$w ( "#pagination1" ). hide ();
$w ( "#pagination1" ). collapse ();
} **else** {
$w ( "#txtdisplay" ). hide ();
$w ( "#repeater1" ). show ();
$w ( "#repeater1" ). expand ();
$w ( "#pagination1" ). show ();
$w ( "#pagination1" ). expand ();
}
}
I tried your code and it was a little complex ;;; it didn’t work unfortunately, even i tried to change everything ;;;;
@sakuraavaargas what error you got
Hi there …
I’ve checked the code on your page, you’re applying the filter on the repeater, not the dataset.
exactly on wich part?? ;;; sorry i’m kinda new on codding this page.
@subasskutti this is what it shows up~ ;;;;