im currently trying to add filters to my website. im using this code:
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
$w ( ‘#resetButton’ ). hide ();
} );
function search ( ) {
wixData . query ( “Team2” )
. contains ( “scuola” , $w ( ‘#input8’ ). value )
. and ( wixData . query ( “Team2” ). contains ( “materie” , $w ( ‘#input7’ ). value ))
. and ( wixData . query ( “Team2” ). contains ( “citta” , $w ( ‘#input11’ ). value ))
. find ()
. then ( results => {
$w ( ‘#repeater2’ ). data = results . items ;
});
$w ( ‘#resetButton’ ). show ();
$w ( ‘#resetButton’ ). enable ();
$w ( ‘#searchButton’ ). hide ();
}
export function searchButton_click ( event ) {
search ()
}
export function resetButton_click_1 ( event ) {
$w ( ‘#teamDataset’ ). setFilter ( wixData . filter ());
$w ( ‘#input7’ ). value = undefined ;
$w ( ‘#input8’ ). value = undefined ;
$w ( ‘#input11’ ). value = undefined ;
$w ( ‘#searchButton’ ). show ();
$w ( ‘#searchButton’ ). enable ();
$w ( ‘#resetButton’ ). hide ();
}
it works fine, but there is a problem. what the code filters are the items displayed in my repeater. but id like to have a load more button on the page, limited to 6. but if i do so, this code will filter only the 6 items that are currently displayed on the website. Any idea to make the code filter everything in my database instead of just the items displayed in the repeater? and would it be possible to also have a load more button for the filtered items? thanks for the help