Filter Repeater by putting Check box on a light box

I have a repeater linked to a database collection and want to filter it using Check boxes. I want the filter selection check boxes to be on a light box so they do not clutter up the repeater page. I have the following code that works well on the repeater page but when i place this code on the light box it can not find the repeater because the repeater is not on the light box. Highlighted section is the problem. Is there some code I could put here to tell it to look for the repeater on another page?

import wixData from ‘wix-data’ ;

export function Filter1_click ( event ) {
search ();
}

function search () {

wixData . query ( "Trails" ) 

. contains ( “featureTag” , String ( $w ( “#checkboxFeature1” ). value ))
. and ( wixData . query ( “Trails” ). contains ( “routeTypeTag” , String ( $w ( “#checkboxTrailtype1” ). value )))

. find ()
. then ( results => {
$w ( “#repeatertrails” ). data = results . items ;
});

}

Adam, what you could do is capture the checkbox values in a function that closes the lightbox and pass those values back to the page with the repeater.

export function btnOk_click(event) {
     let chkBoxObj = {
         "Feature":String($w("#checkboxFeature1").value),
         "Trailtype":String($w("#checkboxTrailtype1").value)
     };
    wixWindow.lightbox.close(chkBoxObj);
}

Back in the page that you’re calling the lightbox from, it would be something like this:

wixWindow.openLightbox("Name of Lightbox")
.then((data) => {
   if (data) {   
     // Put query code here using the object values from the lightbox (data.Feature 
     and data.Trailtype)
   }
})