Hello,
I was wondering if there was a way to resize the repeater after filtering it, stretching vertically the filtered items.
At the moment my repeater shows 9 items by default and its size is set to display all the 9 items.
After filtering it, the repeater vertical size still remains the same, even if just two items from the collection are displayed.
The JS code I am using is the following:
$w . onReady (() => {
$w ( “#dropdown1, #dropdown2, #dropdown3, #dropdown4” ). onChange ( function () {
search ();
});
});
export function reset_button ( event ) {
$w ( “#dynamicDataset” ). setFilter ( wixData . filter ())
$w ( "#dropdown1" ). value = **undefined** ;
$w ( "#dropdown2" ). value = **undefined** ;
$w ( "#dropdown3" ). value = "0" ;
$w ( "#dropdown4" ). value = "1000" ;
}
function search () {
wixData . query ( “dbcollection” )
. contains ( “firstId” , $w ( ‘#dropdown1’ ). value )
. and ( wixData . query ( “dbcollection” )). contains ( “secondId” , $w ( ‘#dropdown2’ ). value )
. and ( wixData . query ( “dbcollection” )). between ( “thirdId” , parseFloat ( $w ( ‘#dropdown3’ ). value ), parseFloat ( $w ( ‘#dropdown4’ ). value ))
. find (). then ( results => {
$w ( "#repeater1" ). data = results . items ;
});
}
Is there a way to automatically stretch the repeater vertical size based on the number of elements shown?
Thank you,
-E